On Thu, Mar 17, 2011 at 3:38 AM, 7stud -- <bbxx789_05ss / yahoo.com> wrote:
> It's possible that your first send() is stuck in a buffer.   
> calling flush() on the socket works.

Determining whether a network connection is still live is generally a
pretty complex thing.  Usually the most reliable way to find out the
status of a connection is to use it.  IIRC there are some socket
options that can influence shutdown behavior and timing.  See for
example here for general description of socket options
http://linux.die.net/man/7/socket

and how to apply them
http://www.ruby-doc.org/stdlib/libdoc/socket/rdoc/classes/BasicSocket.html#M003703

Kind regards

robert

-- 
remember.guy do |as, often| as.you_can - without end
http://blog.rubybestpractices.com/