[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
[Libevent-users] Proper socket shutdown.
Hi Folks,
I was cleaning up some experimental code and wanted to fix up the
network connections to perform a correct/clean socket shutdown handshake.
Unfortunately I can't seem to find any way of doing this through the
existing API, documentation or example code and I'm hoping that I'm simply
missing something. Basically the standard handshake of send a termination
message, shutdown write, continue reading till EOF, shutdown both, close
socket. On the other side basically the same stuff just slightly different
order of behavior.
I don't see how I can call shutdown myself on the socket due to
buffered data which may get truncated if I shutdown before it is all
written, and I can't actually find anything in the library or samples which
calls shutdown to get a starting point to work from. Also, the manual
doesn't cover this detail from what I could see. (It does mention
bufferevent_flush and BEV_FINISHED, but then says not implemented for
sockets.)
So, if you can point me in the correct direction; that would be
wonderful.
KB
***********************************************************************
To unsubscribe, send an e-mail to majordomo@xxxxxxxxxxxxx with
unsubscribe libevent-users in the body.