BeardedManStudios / ForgeNetworkingRemastered

See various forks, also please join the Forge Community fork of Forge Alloy! -> https://github.com/ForgeAlloyCommunity/ForgeAlloy
https://twitter.com/FarrisFaulds
Apache License 2.0
1.49k stars 309 forks source link

Set UDP Client socket to disregard ICMP errors and forcibly disconnect. #315

Open phalasz opened 5 years ago

phalasz commented 5 years ago

After a discussion on discord it was discovered that the ReadThread could encounter a Connection Reset Socket exception while trying to connect to a server that is not running.

The expected behaviour here would be to trigger a connectAttempFailed event, but the exception will close the socket and the loop checking for the connection attempts will be terminated early without firing the event.

Thank you for @andreivreja for finding the possible solution.