The application can hang under certain conditions. This is most visible in IntelliJ, as the run/stop buttons will still be colored indicating that it still runs.
Steps to replicate:
Launch the app
Enter some username
Click "join"
Enter an IP and port combination that is valid, but where something else is running on that port (localhost:3000 worked for me)
Attempt to join
An error dialog will appear. Dismiss it. The console error should be a connection refused error.
Close the app via the window close X.
After following these steps you should see that the application has not stopped running in IntelliJ. This is likely because the TCP system is not closed correctly when that happens? The error handling should be looked at.
NOTE: the issue persists if, after the failed connection attempt, a successful connection is established on a second attempt. Even if the application is closed "correctly" in these cases, in a way that would normally work, it will hang. This might be because the TCP classes that aren't cleaned up after the join never are. Keep an eye on this.
NOTE 2: this may be because the ClientManager starts the sender thread before creating the ClientConnectionManager. If this is necessary, don't catch the connection error in the ClientConnectionManager. Instead handle it in ClientManager and close the sender thread if it happens.
The application can hang under certain conditions. This is most visible in IntelliJ, as the run/stop buttons will still be colored indicating that it still runs.
Steps to replicate:
After following these steps you should see that the application has not stopped running in IntelliJ. This is likely because the TCP system is not closed correctly when that happens? The error handling should be looked at.
NOTE: the issue persists if, after the failed connection attempt, a successful connection is established on a second attempt. Even if the application is closed "correctly" in these cases, in a way that would normally work, it will hang. This might be because the TCP classes that aren't cleaned up after the join never are. Keep an eye on this.
NOTE 2: this may be because the ClientManager starts the sender thread before creating the ClientConnectionManager. If this is necessary, don't catch the connection error in the ClientConnectionManager. Instead handle it in ClientManager and close the sender thread if it happens.