Okay, this sounds simple, but I tried all the simple things and it still doesn't work properly.
import java.net.*;
import java.io.*;
public class MyServer{
public static void main(String[] args) throws IOException {
int MAX_PLAYERS = 1;
int players = 0;
ServerSocket serverSocket = new ServerSocket(43);
while(players < MAX_PLAYERS){
if(players < MAX_PLAYERS)
new MyThread().start(serverSocket.accept());
players++;
}
serverSocket.close();
System.exit(0);
}
}