[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
[Libevent-users] What is the best way to detect a client socket disconnect?
- To: libevent-users@xxxxxxxxxxxxx
- Subject: [Libevent-users] What is the best way to detect a client socket disconnect?
- From: Ken Feng <kfmfe04@xxxxxxxxx>
- Date: Wed, 24 Nov 2010 11:53:52 +0800
- Delivered-to: archiver@xxxxxxxx
- Delivered-to: libevent-users-outgoing@xxxxxxxx
- Delivered-to: libevent-users@xxxxxxxx
- Delivery-date: Tue, 23 Nov 2010 22:54:00 -0500
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:received:date:message-id :subject:from:to:content-type; bh=P4IigcSRuWVlDJCSh+h9oIM40+g0xmPHKyYHHofL97g=; b=a6ucnZ70FxoJgeIW1p2dCM11UHlEhJs4USt6mYea/sYpqgNlvr9ztl8vtz3rz/EwkK ShmjyfRMu4X6+SJlFrj3mDGFrb7wYcL9kuT4Vu2nuRn2Fe2u/3YqY2kwTjM9dRPYzyjc /yuoxFRhi/y84U0w+rDmweaYdbMGqr6Ptpef4=
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type; b=JWHilLKktXptQqDTyW6jgtKLcHtP4p2LTKHnS1VzOM9TJt1BRVvCkDJzKcWZM8ncVG FVCSf1KOvbvlBx0C3473sE1/Udf0uc+PhzHf3xECNJZ89shCGbcRCOW/ATN91unf8Onh FGm/0Fqe8b1xnuKYHweh2f5A7a1/MNCr3brVI=
- Reply-to: libevent-users@xxxxxxxxxxxxx
- Sender: owner-libevent-users@xxxxxxxxxxxxx
Within libevent, of course. As a point of reference, let's say we
start up the TCP Echo server that is in Nick's book here:
http://www.wangafu.net/~nickm/libevent-book/Ref8_listener.html
I could handle a normal client shutdown by sending a special shutdown
sequence from client to server, but what about connection lost? What
is the best way for the server to detect this state? Can I do it
without pinging the client?
Thanks in advance.
- Ken
***********************************************************************
To unsubscribe, send an e-mail to majordomo@xxxxxxxxxxxxx with
unsubscribe libevent-users in the body.