#273 bufferevent_free make peer reset(10054) in IOCP

For_2.1
open
nobody
5
2012-04-27
2012-04-27
fffvvvzz
No

should call shutdown(fd, SD_SEND) first

The closesocket function will initiate cancellation on the outstanding I/O operations, but that does not mean that an application will receive I/O completion for these I/O operations by the time the closesocket function returns. Thus, an application should not cleanup any resources (WSAOVERLAPPED structures, for example) referenced by the outstanding I/O requests until the I/O requests are indeed completed.

Discussion

  • Nick Mathewson
    Nick Mathewson
    2012-04-27

    Seems like we do indeed need an appropriate "bufferevent_shutdown()" function to handle the frequently requested "flush and shutdown or close" operation. Also, we need to make sure than any pending overlapped IO counts as holding a reference on the bufferevent.