我尝试从一位 fb 用户向他的一位朋友发送消息。大多数情况下,消息都会收到。丢失的在日志中被标记为已发送。用于发送消息的 ruby gem 是xmpp4r_facebook,它又使用xmpp4r。示例丢失的消息是Hi, friend! 2013-09-11 17:46:10 +0300
未收到的消息:
Hi, friend! 2013-09-11 17:46:05 +0300
Hi, friend! 2013-09-11 17:46:08 +0300
Hi, friend! 2013-09-11 17:46:13 +0300
Hi, friend! 2013-09-11 17:46:16 +0300
以下是与成功接收消息的日志类似的消息日志:
Debugging mode enabled.
Warnings mode enabled.
RESOLVING:
_xmpp-client._tcp.chat.facebook.com (SRV)
CONNECTING:
chat.facebook.com:5222
"Socket:"
"local address: [\"AF_INET\", 39123, \"172.27.*.**\", \"172.27.*.**\"]"
"Thread list size: 1"
#<TCPSocket:fd 11>
SENDING:
<stream:stream xmlns:stream='http://etherx.jabber.org/streams' xmlns='jabber:client' to='chat.facebook.com' xml:lang='en' version='1.0' >
RECEIVED:
<stream:stream from='chat.facebook.com' id='1' xml:lang='en' xmlns:stream='http://etherx.jabber.org/streams' version='1.0' xmlns='jabber:client'/>
RECEIVED:
<stream:features><starttls xmlns='urn:ietf:params:xml:ns:xmpp-tls'/><mechanisms xmlns='urn:ietf:params:xml:ns:xmpp-sasl'><mechanism>X-FACEBOOK-PLATFORM</mechanism><mechanism>PLAIN</mechanism></mechanisms></stream:features>
FEATURES: received
PROCESSING:
<stream:features xmlns='jabber:client'><starttls xmlns='urn:ietf:params:xml:ns:xmpp-tls'/><mechanisms xmlns='urn:ietf:params:xml:ns:xmpp-sasl'><mechanism>X-FACEBOOK-PLATFORM</mechanism><mechanism>PLAIN</mechanism></mechanisms></stream:features> (REXML::Element)
FEATURES: waiting...
TRYING stanzacbs...
FEATURES: waiting finished
TRYING message/iq/presence/cbs...
SENDING:
<starttls xmlns='urn:ietf:params:xml:ns:xmpp-tls'/>
RECEIVED:
<proceed xmlns='urn:ietf:params:xml:ns:xmpp-tls'/>
TLSv1: OpenSSL handshake in progress
TLSv1: restarting parser
"Socket:"
"local address: [\"AF_INET\", 39123, \"172.27.*.**\", \"172.27.*.**\"]"
"Thread list size: 1"
#<TCPSocket:fd 11>
SENDING:
<stream:stream xmlns:stream='http://etherx.jabber.org/streams' xmlns='jabber:client' to='chat.facebook.com' xml:lang='en' version='1.0' >
RECEIVED:
<stream:stream from='chat.facebook.com' id='1' xml:lang='en' xmlns:stream='http://etherx.jabber.org/streams' version='1.0' xmlns='jabber:client'/>
RECEIVED:
<stream:features><mechanisms xmlns='urn:ietf:params:xml:ns:xmpp-sasl'><mechanism>X-FACEBOOK-PLATFORM</mechanism><mechanism>PLAIN</mechanism></mechanisms></stream:features>
FEATURES: waiting...
FEATURES: received
PROCESSING:
<stream:features xmlns='jabber:client'><mechanisms xmlns='urn:ietf:params:xml:ns:xmpp-sasl'><mechanism>X-FACEBOOK-PLATFORM</mechanism><mechanism>PLAIN</mechanism></mechanisms></stream:features> (REXML::Element)
TRYING stanzacbs...
FEATURES: waiting finished
TRYING message/iq/presence/cbs...
SENDING:
<auth mechanism='X-FACEBOOK-PLATFORM' xmlns='urn:ietf:params:xml:ns:xmpp-sasl'/>
RECEIVED:
<challenge xmlns='urn:ietf:params:xml:ns:xmpp-sasl'>dmVyc2lvbj0x...</challenge>
SASL DIGEST-MD5 challenge:
version=1&method=auth.xmpp_login&nonce=E547D1842...
{"version"=>"1", "method"=>"auth.xmpp_login", "nonce"=>"E547D1842..."}
SENDING:
<response xmlns='urn:ietf:params:xml:ns:xmpp-sasl'>YXBpX2...
</response>
RECEIVED:
<success xmlns='urn:ietf:params:xml:ns:xmpp-sasl'/>
"Socket:"
"local address: [\"AF_INET\", 39123, \"172.27.*.**\", \"172.27.*.**\"]"
"Thread list size: 2"
#<TCPSocket:fd 11>
SENDING:
<stream:stream xmlns:stream='http://etherx.jabber.org/streams' xmlns='jabber:client' to='chat.facebook.com' xml:lang='en' version='1.0' >
RECEIVED:
<stream:stream from='chat.facebook.com' id='1' xml:lang='en' xmlns:stream='http://etherx.jabber.org/streams' version='1.0' xmlns='jabber:client'/>
RECEIVED:
<stream:features><bind xmlns='urn:ietf:params:xml:ns:xmpp-bind'/><session xmlns='urn:ietf:params:xml:ns:xmpp-session'/></stream:features>
FEATURES: received
PROCESSING:
<stream:features xmlns='jabber:client'><bind xmlns='urn:ietf:params:xml:ns:xmpp-bind'/><session xmlns='urn:ietf:params:xml:ns:xmpp-session'/></stream:features> (REXML::Element)
TRYING stanzacbs...
TRYING message/iq/presence/cbs...
SENDING:
<iq id='1192' type='set' xmlns='jabber:client'><bind xmlns='urn:ietf:params:xml:ns:xmpp-bind'/></iq>
RECEIVED:
<iq from='chat.facebook.com' id='1192' type='result'><bind xmlns='urn:ietf:params:xml:ns:xmpp-bind'><jid>-100006248070281@chat.facebook.com/oRbc4KeQ</jid></bind></iq>
SENDING:
<iq id='2614' type='set' xmlns='jabber:client'><session xmlns='urn:ietf:params:xml:ns:xmpp-session'/></iq>
RECEIVED:
<iq from='chat.facebook.com' id='2614' type='result'><session xmlns='urn:ietf:params:xml:ns:xmpp-session'/></iq>
SENDING:
<message to='-1552527098@chat.facebook.com' xmlns='jabber:client'><body> Hi, friend! 2013-09-11 17:46:10 +0300
</body></message>
SENDING:
</stream:stream>
问题出在哪里?它是 FB 错误、gem 错误还是其他什么?