I really can't work out why this wont work... It seems to work everywhere else I've seen it.
try {
ServerSocket serverSocket = new ServerSocket(6644);
} catch (IOException e) {
e.printStackTrace();
}
while(true){
Socket clientSocket = serverSocket.accept();
}
Eclipse keeps telling me 'cannot be resolved' when I hover my mouse over serverSocket on the clientSocket = serverSocket.accept();
line. The variable obviously exists and there isn't a typo so what's the matter?
I've already imported java.io.*
and java.net.*
so I'm pretty sure I have everything I need.