# Socket network handling

**URL:** <https://forum.heroiclabs.com/t/socket-network-handling/568>\
**Category:** Local Setup\
**Created:** [March 16, 2020, 5:15pm UTC](https://forum.heroiclabs.com/t/socket-network-handling/568 "2020-03-16T17:15:40Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![oshribin](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.heroiclabs.com/oshribin/32/349_2.png) [@oshribin](https://forum.heroiclabs.com/u/oshribin)\
**Post date:** [March 16, 2020, 5:15pm UTC](https://forum.heroiclabs.com/t/socket-network-handling/568/1 "2020-03-16T17:15:40Z")

</div>

Is there a way to get notified when a socket message is failed to be sent due to network failure?  
I am using the Unity client. and sending a match state message, in some cases I can’t proceed with the game until the message was successfully sent.  
I want to implement a retry mechanism for when there was a network issue that cause a message to not be sent. But no exception is received even when intentionally closing the network.

Thanks

---

<div class="post-metadata">

**Author:** ![novabyte](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.heroiclabs.com/novabyte/32/1324_2.png) [@novabyte](https://forum.heroiclabs.com/u/novabyte)\
**Post date:** [March 17, 2020, 7:29pm UTC](https://forum.heroiclabs.com/t/socket-network-handling/568/2 "2020-03-17T19:29:42Z")

</div>

> Is there a way to get notified when a socket message is failed to be sent due to network failure?

@oshribin The client sdk can take a small amount of time to detect disconnects due to how the OS handles sockets on most platforms. If an error occurs server-side in a match handler that the player has joined they will receive a socket disconnect (frame control message) before the match handler is stopped.

You can adjust how fast disconnects are picked up both on the client-side in the Unity sdk as well as server-side within the server configuration but note that these will affect players on low bandwidth networks. We’ve chosen the defaults to be a good middle ground for device bandwidth.
