You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
[email protected]? => true
@conn.poll => nil (as if queue has no messages)
So, when I interrupt and try to disconnect, I got exception.
@conn.disconnect if [email protected]? =>
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?
The text was updated successfully, but these errors were encountered:
I am not sure there is a way to accomplish what you want with 'poll'. (At least as it is currently written.) The socket was apparently 'not ready' (or already nil).
I think you would need to actually issue 'receive' (or 'disconnect') in order to see the exception.
Sorry. I will think about this some more, and let you know if I come up with any further ideas.
Re: your connect hash ....... since you have reliable => false, those max_reconnect_xxxx parameters are ignored. Hope you know that.
You might think about reliable => true, with other appropriate parameters, which should trigger the gem to attempt to failover and/or reconnect.
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.
So, when I interrupt and try to disconnect, I got exception.
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?The text was updated successfully, but these errors were encountered: