2011/3/17 Robert Klemme <shortcutter / googlemail.com>:
> 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. See if
>> calling flush() on the socket works.
>
> Determining whether a network connection is still live is generally a
> pretty complex thing.

Using EventMachine (to connect to a TCP server) the #unbind method is
inmediately called when the endpoint closes the connection.

> 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

Ok, I'll check such socket options.
Thanks a lot.

-- 
Iaki Baz Castillo
<ibc / aliax.net>