Subj : Re: close while read-ing To : comp.programming.threads From : Sergei Organov Date : Tue May 31 2005 05:28 pm "David Schwartz" writes: > "Sergei Organov" wrote in message > news:d7erdp$k57$1@n6.co.ru... > [...] > > Alternatively, I thought that maybe there is some documentation that > > I've overlooked that describes blocking syscalls behavior with respect > > to asynchronous syscalls from other threads, and that's why I've asked > > you for reference. > > Again, you are thinking about this the wrong way. A thread that is > blocking in a socket operation is *always* waiting for something to happen > that is asynchronous with respect to that thread. Thanks a lot. Now its seem I've got your explanation (at least partially). Do I now understand right that shutdown() doesn't do anything special with respect to thread(s) waiting in recv(); instead, the result of shutdown() execution is a change in underlying connection state that is then handled as usual? What is still unclear: is shutdown() call from another thread the right way to close a stuck connection in the case when the peer has silently disappeared? Does SO_LINGER option have anything to do with it (the setsockopt() man page suggests it only affects close(), not shutdown())? -- Sergei. .