Al 25/05/11 21:42, En/na Ludo Brands ha escrit: > SO_LINGER has some side effects in closing a socket. From > http://msdn.microsoft.com/en-us/library/ms737582%28v=vs.85%29.aspx: If the > l_onoff member of the LINGER structure is zero (the default for a socket), > closesocket returns immediately and the connection is gracefully closed in > the background. > Gracefully means sending remaining data and shutdown handshake.
If there's any remaining data, it should send that, not keepalive packets, shouldn't it? I saw the retries in the shutdown handshake when I pulled the cable, even after I closed the application, and I find that normal. > The "in the > background" could mean that this could take a while and not finished when > the app is already closed. It was a very long while and, again, I think it should send either the remaining data (there was none, BTW) or try to tear down the connection, not sending keepalive packets. > Could also explain the fact that the problem is > not always repeatable. > > The additional CloseSocket doesn't return an error? I don't know (since I'm closing down I don't check the error), but I see two FIN on the wire (both acknowledged by the peer). BTW, I later discovered that the computer was infected with conficker, I don't know if that's relevant or not. Bye -- Luca ------------------------------------------------------------------------------ vRanger cuts backup time in half-while increasing security. With the market-leading solution for virtual backup and recovery, you get blazing-fast, flexible, and affordable data protection. Download your free trial now. http://p.sf.net/sfu/quest-d2dcopy1 _______________________________________________ synalist-public mailing list synalist-public@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/synalist-public