?
2011-05-24 10:56:39 UTC
import java.net.*;
import java.io.*;
import java.util.*;
import java.net.*;
public class GameServer {
public static void main(String args[]) {
ServerSocket serverSocket = null;
//ServerSocket receptionSocket = null;
System.out.println("Server started.. Waiting for clients.");
try {
serverSocket = new ServerSocket(1111);
}
catch (IOException ex) {
System.err.println("Cannot create server socket.");
}
for(;;)
{
Socket socke = null;
try {
socke = serverSocket.accept();//ERROR HERE
}
catch (IOException e) {
System.out.println("Problem accepting client socket.");
}
GameFrame calculator = new GameFrame(socke);
Thread t = new Thread(calculator);
t.start();
System.out.println("Calculator started.");
}
}
}