I use RabbitMQ and create new connection:
let delegate = RMQConnectionDelegateLogger()
conn = RMQConnection(uri: "...", delegate: delegate)
conn.start()
ch = conn.createChannel()
How can I detect - is this connection valid or not?
I use RabbitMQ and create new connection:
let delegate = RMQConnectionDelegateLogger()
conn = RMQConnection(uri: "...", delegate: delegate)
conn.start()
ch = conn.createChannel()
How can I detect - is this connection valid or not?
In general you have to start using connection to check whether it is still usable or not. You may yield any network operation over it, e.g. setting QOS, with, say, prefetch-count = 3
(note, 3 or any other value could be a default and if your client library do not re-send qos when value is already set to the same value, pick some other value).
To prevent server to close connection after some inactivity period you may try to use hearbeats.
If you have some other platform or environment-specific ways to check for the internet connection you may definitely use it (perhaps Check for internet connection with Swift question could be in handy in this particular case).