Created attachment 1167021 [details]
Description of problem:
It turns out that under some Linux kernels (including rhel5 and rhel6), select(2) does not return as writable sockets which have been closed from the other end, even though calls to sendmsg (which is what POSIX gives as the implied output function for sockets) would not block. This can result in Tcl's leaking socket-descriptors.
I reported this bug upstream two years ago:
but forgot to raise it here.
I've attached a patch derived from upstream's fix.
Closing according to bug 1344866 comment 8. If the problem persist, feel free to reopen.