lidgren / lidgren-network-gen3

Lidgren Network Library
https://groups.google.com/forum/#!forum/lidgren-network-gen3
MIT License
1.19k stars 331 forks source link

ICMP Destination unreachable (port unreachable) won't close connection #157

Closed teremy closed 1 year ago

teremy commented 1 year ago

Hi. I am using Lidgren Network with Unity and having two clients communicate with each other. If I use the task manager to kill the server, the client doesn't recognize the disconnect. There is no status change. Using wireshark I can see that the keep alive/heartbeat packets are still send but for every try there is an ICMP Destination unreachable (Port unreachable). In the Lidgren Networking source code I found this (NetPeer.Internal.cs): // connection reset by peer, aka connection forcibly closed aka "ICMP port unreachable" // we should shut down the connection; but m_senderRemote seemingly cannot be trusted, so which connection should we shut down?! // So, what to do? Does it have something todo with this? In the code it will just return without further action. Why can m_senderRemote not be trusted and what should I do now?

teremy commented 1 year ago

It was a mistake on my part with setting the timeout value very high for testing purpose.