Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo

Close

#47 Expose shutdown() for bufferevent closing

API
open
nobody
General (24)
5
2010-10-05
2010-10-05
Nick Mathewson
No

Many operating systems do better if you shutdown(fd, SHUT_WR) a socket with pending data before closing it, so that the other side gets a FIN rather than a RST.

Chris pulled up http://tools.ietf.org/html/rfc1122#section-4.2.2.13 and http://lxr.linux.no/linux+v2.6.27.4/net/ipv4/tcp.c#L1785 to make the point, and they seem to be sensible.

The right API here could be a bit tricky. A socket-based bufferevent_flush() implementation might be the right place, but it could bear thinking about.

Discussion