Andrei486 / uml-diagram-collab

0 stars 0 forks source link

Application does not close TCP correctly after failing to join #132

Closed Andrei486 closed 2 months ago

Andrei486 commented 5 months ago

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.