Hi, Here the source code of a simple server that accept one client.
When the client disconnect the callback for io is call infinitely with zero bytes recv. Here the behaviour: first terminal 1) ./main 4) <-- READ: 0 5) <-- READ: 0 6) <-- READ: 0 7) <-- READ: 0 8) CTRL+C second terminal 2) nc localhost 19206 3) CTRL+C My questions are : 1) Can I assume that if the recv return zero mean that the client have been disconnected? 2) I register SIGPIPE I thought that I will receive a even of it when the clients disconnect but I don't? 3) What is the best way or recommended way to manage the clients disconnections and unregistered the socket from libev? Best Regards, -- Kevyn-Alexandre Pare
Main.cxx
Description: Binary data
_______________________________________________ libev mailing list [email protected] http://lists.schmorp.de/cgi-bin/mailman/listinfo/libev
