I have a server program running on my laptop, same router and same code. It work's fine and clients can connect. However when I copied the workspace to my PC and when I run it, I get this nonsense:
IO error java.net.SocketException: select failed
Here is the code...
public static void main(String[] args) {
System.out.println("running server!");
int nreq = 1;
try{
ServerSocket sock = new ServerSocket(7331);
for(;;){
Socket newsock = sock.accept();
System.out.println("Creating thread...");
//Thread t = new ThreadHandler(newsock, nreq);
//t.start();
nreq++;
}
}
catch(Exception e)
{
System.out.println("IO error " + e);
}
Basically what could cause this error (of which I can find no useful information online) to happen on one PC and not another? It has to be something about the PC itself. I am most confused. Basically it can't open a socket?
Here is the full stacktrace:
java.net.SocketException: select failed
at java.net.PlainSocketImpl.socketAccept(Native Method)
at java.net.PlainSocketImpl.accept(Unknown Source)
at java.net.ServerSocket.implAccept(Unknown Source)
at java.net.ServerSocket.accept(Unknown Source)
at Server.main(Server.java:18)
If it's relevant, I'm using Windows 7 64 bit Ultimate on the PC which is giving me problems. The laptop that it works fine on is Windows 7 32 bit. So the only discernible difference I can tell is 32 vs 64 bit.
Could this be relevant? I don't understand it. http://forums.codeguru.com/showthread.php?522257-Windows-Sockets-64-bit