Print

Print


On Tue, 23 Aug 2011, Brian Bockelman wrote:

> I'm not quite following what the issue is from the in-code comments, 
> but isn't this what SO_LINGER (POSIX-compliant) is for?
No, that isn't (at least wasn't) a solution for the problem. If there
was an operation in progress when you closed the socket, the close would 
not be reflected to the person who initiated the operation (unlike all 
other operating systems) until some activity occurred that caused the 
kernel to re-inspect the operation (e,g, signal). So, the initiating 
thread would simply hang. That might no longer be the case in current 
versions of Linux. But in the day it was a huge hassle since async 
close() operations occur relatively frequently. Anyway, the implementation 
of SO_LINGER varies from OS to OS and even in versions of an OS. That's 
what I found when dealing with this pronlem and that's what people say out 
there.

Andy