Hello!
[wrap your lines to something below 80 chars please]
On Mon, Nov 28, 2005 at 11:47:19AM -0800, Mathew Mills wrote:
>It doesn't look like libevent supports an exceptional or error event.
>There are times in many protocols where you neither want to read from nor
>write to a socket, but you do want to know if the socket is disconnected
>by the peer. select/poll/epoll/rtsig all have access to this kind of
>event, so why isn't this exposed through libevent?
IIRC the "exceptional" condition thing in select is signalled only
for urgent data, but not for closed down sockets. Sockets with errors
signal readable/writable IIRC, and if you don't want to actually read,
you could either use recv with the option MSG_PEEK or the getsockopt
mentioned recently:
int error;
socklen_t error_len = sizeof(error);
if (getsockopt(sd, SOL_SOCKET, SO_ERROR, &error, &error_len) < 0)
error handling for getsockopt
if (error != 0)
error handling for the socket (error is the errno)
>Would a patch adding this event be welcomed?
Kind regards,
Hannah.
_______________________________________________
Libevent-users mailing list
[email protected]
http://monkey.org/mailman/listinfo/libevent-users