-
Notifications
You must be signed in to change notification settings - Fork 6
Logging in after failed attempt results in application hanging #23
Comments
I don't have a solution, but I've narrowed in on what is happening. The ClientConnectionThread thread is dying and not getting reopened. Is this intentional? Is there supposed to be a new connection for every request? Adding this sloppy change to ServerConnection#getResponse "fixes" the issue, or so it seems. I'm a bit confused, I'll leave this up to you. If you didn't know this was happening I hope this leads you to finding the cure. private Response getResponse(Request request) throws IOException, ClassNotFoundException {
writeOut(request);
Response response = (Response) in.readObject();
if(response.getStatus() != 200){
open("localhost", 1244);
return null;
}
return response;
} |
You're right in thinking there should be a new ClientConnectionThread for each client. This does help and I'll take a better look at it tomorrow, but my feeling is that the connection to the server is being closed when the first login fails and then not being re-opened. Perhaps the solution is to open and close the connection to the server upon every request like is done for the Database |
I know there should be a new one for each client, but should there be a new one for every request a client submits? |
@nkarasch No there shouldn't. 1 thread should manage 1 client for the entirety of the time that the client is running |
Ok I've done some digging and it looks like this is because the AuthenticationException is caught outside of the thread loop in the ClientConnectionThread. I have corrected it, but as I have done some refactoring of that class for PR #24 I will add the fix to that. |
Steps to reproduce:
The text was updated successfully, but these errors were encountered: