Question

This question is a bit tricky and I don't really think I'll find an answer but I'll try anyway.

I'm writing a C++ program using gloox for XMPP transfers. My problem , which is happening only on my computer, (Linux Mint 13 MATE 32bits) is that the "onConnect()" handler is never called. This was not a problem when we were using the jabber.org server (actually, I didn't even know it was not called...) but problems started occuring when we installed a LAN ejabberd server.

Using jabber.org server, even though "onConnect" was not called the application was able to send/receive messages fine. But not on ejabberd. At first I thought it was a problem with the certificate or something but then we tried on our other Linux boxes (Ubuntu 12.04 x64, Arch x64 and Debian 6.0 32(the server is running on this machine)) and it works fine on any of those computers. Plus, the sister application using Python-Twisted can connect fine on the problematic computer.

The validation function, onTLSConnect() is called everytime and it returns true. On the problematic computer, when using our ejabberd server, the connection isn't established after that and the socket closes it self after about 25 seconds ( and onDisconnect() is called...)

So, my question: Could there be an internet setting (like a firewall?) that is preventing Gloox to terminate the connection. OR has anyone experienced a similar issue? Thanks!

EDIT: I made a VM of Mint 13 MATE 32bits on my laptop and the same problem arises. I can now conclude it's bug somewhere in mint.

EDIT2: Works fine on Mint 64 bits....I opened a ticket on Mint's bug page

Was it helpful?

Solution

i meet this problem last week, it seems a bug of gloox. it happened on 32 bit linux. see this https://bugs.launchpad.net/linuxmint/+bug/1071416

in fact.you are "online" on the server, but your "presence" state is unknown. you can simply send a "Chat" state to the server to continute your work.

like this

#ifdef GLOOX_ON_CONNECT_BUG_PATCH
    Poco::Thread::sleep(3000);//休息3秒,然后连接成功,哎,该死的bug
    this->is_connected = true;
    client->setPresence(Presence::Chat, 0);
#endif
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top