views:

35

answers:

0

Hi all.

I'm trying to write own jabber bot on c++/gloox. Everything goes fine, but when internet connection is down - bot thinks that it's still connected, and when connection is up again - of course bot doesn't respond to any message.

Each time since bot is successfully connected gloox' recv() returns ConnNoError, even if interface is down and cable unplugged.

Tried use blocking and non-blocking gloox' connection and recv() and all was without any result. Periodic checks of availability of xmpp server in different thread is not seems like a good idea, so how to properly check is bot connected right now or no?

If it's not possible to do with gloox only - please point me on some good method, but let it be availible in unix.