repeating topic : detectect uncleanly closed socket Software GmbH - Martin Peter Hanke mphanke at
Fri Aug 7 20:04:32 CEST 2015

Hi all

I finally managed my implementation of an multi-threaded socket server 
with libev.

Now there is one thing left: detecting uncleanly disconnected sockets.

At the moment the approach of the client is the following:

1x ioReadWatcher
1x ioWriteWatcher
1x stopWatcher
1x timerWatcher called every 10/20/30 sec

I'm looking for a nice approach to implement the detection, as my 
devices are on a mobile network, due to this might loose connection.

Reconnect is cleanly handled.
But if the socket disconnects uncleanly, the timer keeps running and the 
client is kept open...

What is the suggested approach to implement this.
Any suggestions and code snippets are highly welcome!

Thanks in advance


More information about the libev mailing list