How to check of connection was closed by remote host?
I'm trying to make a thread, that receive stomp messages and another stuff and reconnect, when the connection is down. But I could not determine, when it is down.
!@conn.closed? => true
@conn.poll => nil (as if queue has no messages)
So, when I interrupt and try to disconnect, I got exception.
@conn.disconnect if !@conn.closed? =>
An existing connection was forcibly closed by the remote host..
I don't want to remove this exception. I want to know if connection was already closed before @conn.disconnect. Is there a way to do this?