I have coded a server-client chat, as many others, but I have a little problem. The chat works perfectly and you can chat all you want, but now its on a rather big server and after the chat server has been online for a while you can't join the chat anymore. I write the error message in a file and it says "Connection reset".

Here goes the code of the ServerSocket listener thread(where the error should be), if you got any tips please share them with me. (and getMess is a thread class and not a method, bad choice of name by me)

class Connect extends Thread
{

private int port;
private ChatServer cs;
private LinkedList playerList;
private ServerSocket listenSock;

public Connect(LinkedList l) throws IOException
{
super("GH Chat Server");
playerList = l;
port = 8072;
cs = new ChatServer(playerList);
this.start();
}

public void run()
{
try
{
ServerSocket listenSock = new ServerSocket(port);
while(!interrupted())
{
Socket clientSock = listenSock.accept();
new getMess(clientSock, cs, playerList);
}
}
catch(Exception e)
{
try
{
File f1 = new File("error_logs");
f1.mkdir();
File path = new File("error_logs\\error.rtf");
RandomAccessFile fil = new RandomAccessFile(path, "rw");
fil.seek(fil.length());
fil.writeBytes(e.getMessage() + '\n' + "End of transmission!!" + '\n');
fil.close();
}
catch(Exception ie){}
}
}
}