Skip to content

if !@conn.closed? @conn.disconnect => connection was forcibly closed by the remote host #110

@georgy7

Description

@georgy7

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions