willardf / Hazel-Networking

Hazel Networking is a low level networking library for C# providing connection-oriented, message-based communication via RUDP.
MIT License
385 stars 60 forks source link

Add an event to bubble up ConnectionListeners shutting down for an internal error #48

Closed willardf closed 2 years ago

willardf commented 2 years ago

Copied from the in-code remarks: Support for this is still pretty limited. At the time of writing, only iOS devices need this in one case: When iOS suspends an app, it might also free our socket while not allowing Unity to run in the background. When Unity resumes, it can't know that time passed or the socket is freed, so we used to continuously throw internal errors.

Also I noticed that DtlsConnectionListener wasn't inherited from NetworkConnectionListener. Saves a few lines to do that.