当前位置: 代码迷 >> J2SE >> 关于socket的java.net.SocketException: select failed异常的有关问题
  详细解决方案

关于socket的java.net.SocketException: select failed异常的有关问题

热度:165   发布时间:2016-04-24 01:52:26.0
关于socket的java.net.SocketException: select failed错误的问题
[code=Java][/code]
package test;

import java.net.*;
import java.io.*;

public class TCPServer {

  public static void main(String[] args) throws Exception {
  ServerSocket ss = new ServerSocket(6666);
  Socket s = ss.accept();
  System.out.println("a client connect!");
  }
}
这是服务器的
package test;

import java.io.*;
import java.net.*;

public class TCPClient {
public static void main(String[] args) throws Exception {
Socket s = new Socket("127.0.0.1",6666);
}
}

错误run:
Exception in thread "main" java.net.SocketException: select failed
at java.net.PlainSocketImpl.socketAccept(Native Method)
at java.net.PlainSocketImpl.accept(PlainSocketImpl.java:408)
at java.net.ServerSocket.implAccept(ServerSocket.java:462)
at java.net.ServerSocket.accept(ServerSocket.java:430)
at test.TCPServer.main(TCPServer.java:10)
Java Result: 1

我的win7系统没扣ipv6的选项的怎么出这个问题了

------解决方案--------------------
估计是客户端没发送数据,服务端就接受了?
  相关解决方案