gloox 链接服务器问题 服务器是openfire

这是我用gloox的example改的,登录服务器的时候出现来以下问题:

log: level: 0, area: 8, connection encryption active
log: level: 0, area: 16384, <?xml version='1.0' ?><stream:stream to='192.168.148.128' xmlns='jabber:client' xmlns:stream='http://etherx.jabber.org/streams'  xml:lang='en' version='1.0'>
log: level: 0, area: 8192, <stream:stream xmlns:stream='http://etherx.jabber.org/streams' xmlns='jabber:client' from='localhost.localdomain' id='9c802eca' xml:lang='en' version='1.0'/>
log: level: 0, area: 8192, <stream:features><mechanisms xmlns='urn:ietf:params:xml:ns:xmpp-sasl'><mechanism>DIGEST-MD5</mechanism><mechanism>PLAIN</mechanism><mechanism>ANONYMOUS</mechanism><mechanism>CRAM-MD5</mechanism></mechanisms><compression xmlns='http://jabber.org/features/compress'><method>zlib</method></compression><auth xmlns='http://jabber.org/features/iq-auth'/><register xmlns='http://jabber.org/features/iq-register'/></stream:features>
log: level: 0, area: 16384, <auth xmlns='urn:ietf:params:xml:ns:xmpp-sasl' mechanism='DIGEST-MD5'/>
log: level: 0, area: 8192, <challenge xmlns='urn:ietf:params:xml:ns:xmpp-sasl'>cmVhbG09ImxvY2FsaG9zdC5sb2NhbGRvbWFpbiIsbm9uY2U9InZDakdkQldGckFoWXE3T3RJRDAxOHcwSmxra2F2RU4xM1VIS2V4RHIiLHFvcD0iYXV0aCIsY2hhcnNldD11dGYtOCxhbGdvcml0aG09bWQ1LXNlc3M=</challenge>
log: level: 0, area: 4, processing SASL challenge
log: level: 0, area: 16384, <response xmlns='urn:ietf:params:xml:ns:xmpp-sasl'>dXNlcm5hbWU9Inpob3UiLHJlYWxtPSJsb2NhbGhvc3QubG9jYWxkb21haW4iLG5vbmNlPSJ2Q2pHZEJXRnJBaFlxN090SUQwMTh3MEpsa2thdkVOMTNVSEtleERyIixjbm9uY2U9IjZiOGI0NTY3MzI3YjIzYzY2NDNjOTg2OTY2MzM0ODczIixuYz0wMDAwMDAwMSxxb3A9YXV0aCxkaWdlc3QtdXJpPSJ4bXBwLzE5Mi4xNjguMTQ4LjEyOCIscmVzcG9uc2U9MWFlZDU0MTFjZmMyYmQ2ZTcyZWM2M2NjNWQ0MjZjMzQsY2hhcnNldD11dGYtOA==</response>
log: level: 0, area: 8192, <failure xmlns='urn:ietf:params:xml:ns:xmpp-sasl'><not-authorized/></failure>
log: level: 2, area: 4, SASL authentication failed!
log: level: 0, area: 16384, </stream:stream>
message_test: disconnected: Device or resource busy
auth failed. reason: 6
SASL authentication failed! 这个我问题我通过j->setForceNonSasl(true);来解决,不过还是有点问题,没有解决其根本问题.

编译结果如下:

[root@localhost jni]# g++ -g e2ee_client.cpp /usr/local/lib/libgloox.so -lpthread
e2ee_client.cpp: 在成员函数‘void MessageTest::start()’中:
e2ee_client.cpp:44:30: 警告:不建议使用‘void gloox::Client::setForceNonSasl(bool)’(声明于 /usr/local/include/gloox/client.h:223)
运行结果如下:

log: level: 0, area: 16384, </stream:stream>
message_test: disconnected: Device or resource busy
auth failed. reason: 0
这个错误没有来,但是Device or resource busy这个问题还是不知道那里出问题来,希望有高手解答一下!

你可能感兴趣的:(xml,Stream,服务器,Authentication,processing,encryption)