首先,请提前感谢您与我一起看看这个问题。
我目前正在使用strophe.js通过BOSH连接连接Punjab,最终将消息转发给Openfire。我在服务器上进行预绑定并使用strophe连接到连接。这最初工作正常;我可以发送和接收消息,当我获得空闲ping时,我能够成功响应。但是,过了一段时间,我已经断开连接了。
在检查旁遮普记录之后,当我从strophe发送消息时,我似乎总是得不到旁遮普的httpbind确认。 Strophe按照预期等待60秒,并尝试再次发送消息 - 具有相同ID的完整副本。这是有道理的,因为它不知道旁遮普是否曾得到过这个消息,因为它从未承认过它。但是,出于某种原因,Punjab得到了这个重复的消息并且认为它是一个具有不正确RID的新消息,因此它增加了它的内部RID计数器,就像任何其他消息一样。此外,它将消息转发到Openfire服务器AGAIN,虽然我没有看到这个有任何重大影响,据我所知。最后,在多次发生这种情况之后,Strophe使用的RID落在RID容差窗口之外,Punjab返回404 Not Found错误,最终关闭连接。
我的问题是,旁遮普为什么不承认应该发送的一些消息 - 让<body xmlns='http://jabber.org/protocol/httpbind'/>
回到正确的位置。
此过程详细介绍了以下日志中的示例:
2012-06-22 20:17:23-0400 [HTTPChannel,21,127.0.0.1] HEADERS 1340410643.66: Punjab gets a message from the HTTP Bind (this is why we are observing activity in HTTPChannel)
2012-06-22 20:17:23-0400 [HTTPChannel,21,127.0.0.1] {'origin': 'http://172.16.160.246', 'content-length': '191', 'accept-language': 'en-US,en;q=0.8', 'accept-encoding': 'gzip,deflate,sdch', 'x-forwarded-host': '172.16.160.246', 'x-forwarded-for': '172.16.122.9', 'host': '127.0.0.1:5280', 'accept': '*/*', 'user-agent':'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/536.5 (KHTML, like Gecko) Chrome/19.0.1084.56 Safari/536.5', 'accept-charset': 'ISO-8859-1,utf-8;q=0.7,*;q=0.3', 'connection': 'Keep-Alive', 'referer': 'http://172.16.160.246/MySite/Viewers/InteractiveView?programGuideId=486', 'cookie': 'ASP.NET_SessionId=c4ioeuw2azw21lkedv0nbwlt; .MySiteUniqueCookie=92416C9E3804DF3F6B5661F5B6447314BA070C1FE9BF3D6830AA256AFFA84CAB691B1E3746DBFD4E99692CC18F831C89810CDF256CD12EAF3EA351FEF240605589BE9AE835B9D862265A1672749B5DF9E7AADEE8BEC95006A410CDA5D25271964C9EE065AB968AB3C9521BC9D1059D545FA40575FB477AC3FFDD4F4A702334D2A83C9C90', 'x-forwarded-server': 'CODEMONKEY.mydomain.com', 'content-type': 'application/xml'}
2012-06-22 20:17:23-0400 [HTTPChannel,21,127.0.0.1] HTTPB POST : This is the POST message coming from the BOSH connection
2012-06-22 20:17:23-0400 [HTTPChannel,21,127.0.0.1] You can see that it is in an httpbind protocol body
<body rid='1211827046' xmlns='http://jabber.org/protocol/httpbind' sid='fb03e4779f4b9a4fe15fbf09d5905f455cc54919'>
<iq type='result' to='codemonkey' id='511-862' xmlns='jabber:client'/>
</body>
2012-06-22 20:17:23-0400 [HTTPChannel,21,127.0.0.1] 1211827046
2012-06-22 20:17:23-0400 [HTTPChannel,21,127.0.0.1] Here, Punjab strips the httpbind body and sends the root message directly to OpenFire
SID: fb03e4779f4b9a4fe15fbf09d5905f455cc54919 => using the direct session connection Punjab has set up for this user (evidenced by the SID).
SEND: "
<iq xmlns='jabber:client' to='codemonkey' type='result' id='511-862'/>"
HOWEVER, HERE WE ARE MISSING THE HTTPBIND CONFIRMATION THAT SHOULD BE SENT BACK TO STROPHE, LETTING IT KNOW THAT THE MESSAGE WAS FORWARDED
THUS, STROPHE SENDS THE SAME MESSAGE AGAIN WITH THE SAME RID, THINKING THAT PUNJAB NEVER GOT THE FIRST ONE.
2012-06-22 20:18:28-0400 [HTTPChannel,22,127.0.0.1] HEADERS 1340410708.95: Punjab gets a message from the HTTP Bind (this is strophes second attempt at sending the message)
2012-06-22 20:18:28-0400 [HTTPChannel,22,127.0.0.1] {'origin': 'http://172.16.160.246', 'content-length': '191', 'accept-language': 'en-US,en;q=0.8', 'accept-encoding': 'gzip,deflate,sdch', 'x-forwarded-host': '172.16.160.246', 'x-forwarded-for': '172.16.122.9', 'host': '127.0.0.1:5280', 'accept': '*/*', 'user-agent':'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/536.5 (KHTML, like Gecko) Chrome/19.0.1084.56 Safari/536.5', 'accept-charset': 'ISO-8859-1,utf-8;q=0.7,*;q=0.3', 'connection': 'Keep-Alive', 'referer': 'http://172.16.160.246/MySite/Viewers/InteractiveView?programGuideId=486', 'cookie': 'ASP.NET_SessionId=c4ioeuw2azw21lkedv0nbwlt; .MySiteUniqueCookie=92416C9E3804DF3F6B5661F5B6447314BA070C1FE9BF3D6830AA256AFFA84CAB691B1E3746DBFD4E99692CC18F831C89810CDF256CD12EAF3EA351FEF240605589BE9AE835B9D862265A1672749B5DF9E7AADEE8BEC95006A410CDA5D25271964C9EE065AB968AB3C9521BC9D1059D545FA40575FB477AC3FFDD4F4A702334D2A83C9C90', 'x-forwarded-server': 'CODEMONKEY.mydomain.com', 'content-type': 'application/xml'}
2012-06-22 20:18:28-0400 [HTTPChannel,22,127.0.0.1] HTTPB POST :
2012-06-22 20:18:28-0400 [HTTPChannel,22,127.0.0.1]
<body rid='1211827046' xmlns='http://jabber.org/protocol/httpbind' sid='fb03e4779f4b9a4fe15fbf09d5905f455cc54919'>
<iq type='result' to='codemonkey' id='511-862' xmlns='jabber:client'/>
</body>
2012-06-22 20:18:28-0400 [HTTPChannel,22,127.0.0.1] 1211827046
2012-06-22 20:18:28-0400 [HTTPChannel,22,127.0.0.1]
SID: fb03e4779f4b9a4fe15fbf09d5905f455cc54919 => PUNJAB SENDS THIS TO OPENFIRE AS WELL, EVIDENCE THAT PUNJAB FAILS TO DETECT THAT THIS IS A DUPLICATE MESSAGE
SEND: " It seems that Openfire must disregard this, considering that we haven’t seen issues with openfire receiving these messages.
<iq xmlns='jabber:client' to='codemonkey' type='result' id='511-862'/>" and haven’t seen duplicate messages through chat or anything.
2012-06-22 20:18:28-0400 [HTTPChannel,22,127.0.0.1] RETURN HTTPB 1340410708.95:
2012-06-22 20:18:28-0400 [HTTPChannel,22,127.0.0.1] PUNJAB SENDS OUT THE HTTPBIND ACKNOWLEDGEMENT, AS IT SHOULD HAVE THE FIRST TIME.
<body xmlns='http://jabber.org/protocol/httpbind'/>
2012-06-22 20:18:28-0400 [HTTPChannel,22,127.0.0.1] 1211827046
2012-06-22 20:18:28-0400 [HTTPChannel,22,127.0.0.1] 127.0.0.1 - - [23/Jun/2012:00:18:28 +0000] "POST /bosh HTTP/1.1" 200 51 "http://172.16.160.246/MySite/Viewers/InteractiveView?programGuideId=486" "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/536.5 (KHTML, like Gecko) Chrome/19.0.1084.56 Safari/536.5"
Since Punjab sees the duplicate request as a new request, it has incremented its internal RID counter for both, meaning we are now off by 1 RID (each message sent from strophe is supposed to increment the RID value by 1). The first few times this happens, the connection remains because Punjab has a tolerance window of about 5. Eventually, we get out of this window, and Punjab closes the connection.
2012-06-22 20:23:13-0400 [HTTPChannel,22,127.0.0.1] HEADERS 1340410993.78:
2012-06-22 20:23:13-0400 [HTTPChannel,22,127.0.0.1] {'origin': 'http://172.16.160.246', 'content-length': '191', 'accept-language': 'en-US,en;q=0.8', 'accept-encoding': 'gzip,deflate,sdch', 'x-forwarded-host': '172.16.160.246', 'x-forwarded-for': '172.16.122.9', 'host': '127.0.0.1:5280', 'accept': '*/*', 'user-agent':'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/536.5 (KHTML, like Gecko) Chrome/19.0.1084.56 Safari/536.5', 'accept-charset': 'ISO-8859-1,utf-8;q=0.7,*;q=0.3', 'connection': 'Keep-Alive', 'referer': 'http://172.16.160.246/MySite/Viewers/InteractiveView?programGuideId=486', 'cookie': 'ASP.NET_SessionId=c4ioeuw2azw21lkedv0nbwlt; .MySiteUniqueCookie=0772CAEB889BB1F853371E4153AC6972595A3A548BAE87D3F8D86AFBB5B88B4C0B8FD61F971816D4678388499B0A71E2517048261B07AD393D9EECDA199FA7EA51CBCD17299047473C6B9A9667BAF9367059319B4F0292B57238A0E2DB2AC737B12E530EAAE85732B1070E1F563E7675A82DF41C57A2C705B358328BE477C581D02DC714', 'x-forwarded-server': 'CODEMONKEY.mydomain.com', 'content-type': 'application/xml'}
2012-06-22 20:23:13-0400 [HTTPChannel,22,127.0.0.1] HTTPB POST :
2012-06-22 20:23:13-0400 [HTTPChannel,22,127.0.0.1]
<body rid='1211827048' xmlns='http://jabber.org/protocol/httpbind' sid='fb03e4779f4b9a4fe15fbf09d5905f455cc54919'>
<iq type='result' to='codemonkey' id='600-864' xmlns='jabber:client'/>
</body>
2012-06-22 20:23:13-0400 [HTTPChannel,22,127.0.0.1] 1211827048
2012-06-22 20:23:13-0400 [HTTPChannel,22,127.0.0.1] This rid is invalid 1211827048 1211827052 ITS INTERNAL RID COUNTER HAS INCREASED TO 52 WHILE WE ARE AT 48.
2012-06-22 20:23:13-0400 [HTTPChannel,22,127.0.0.1] HTTPB Error 404 The tolerance has been exceeded and the connection is closed.
2012-06-22 20:23:13-0400 [HTTPChannel,22,127.0.0.1] 127.0.0.1 - - [23/Jun/2012:00:23:13 +0000] "POST /bosh HTTP/1.1" 404 - "http://172.16.160.246/MySite/Viewers/InteractiveView?programGuideId=486" "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/536.5 (KHTML, like Gecko) Chrome/19.0.1084.56 Safari/536.5"
Since Punjab sees the duplicate request as a new request, it has incremented its internal RID counter for both, meaning we are now off by 1 RID (each message sent from strophe is supposed to increment the RID value by 1). The first few times this happens, the connection remains because Punjab has a tolerance window of about 5. Eventually, we get out of this window, and Punjab closes the connection.
2012-06-22 20:23:13-0400 [HTTPChannel,22,127.0.0.1] HEADERS 1340410993.78:
2012-06-22 20:23:13-0400 [HTTPChannel,22,127.0.0.1] {'origin': 'http://172.16.160.246', 'content-length': '191', 'accept-language': 'en-US,en;q=0.8', 'accept-encoding': 'gzip,deflate,sdch', 'x-forwarded-host': '172.16.160.246', 'x-forwarded-for': '172.16.122.9', 'host': '127.0.0.1:5280', 'accept': '*/*', 'user-agent':'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/536.5 (KHTML, like Gecko) Chrome/19.0.1084.56 Safari/536.5', 'accept-charset': 'ISO-8859-1,utf-8;q=0.7,*;q=0.3', 'connection': 'Keep-Alive', 'referer': 'http://172.16.160.246/MySite/Viewers/InteractiveView?programGuideId=486', 'cookie': 'ASP.NET_SessionId=c4ioeuw2azw21lkedv0nbwlt; .MySiteUniqueCookie=0772CAEB889BB1F853371E4153AC6972595A3A548BAE87D3F8D86AFBB5B88B4C0B8FD61F971816D4678388499B0A71E2517048261B07AD393D9EECDA199FA7EA51CBCD17299047473C6B9A9667BAF9367059319B4F0292B57238A0E2DB2AC737B12E530EAAE85732B1070E1F563E7675A82DF41C57A2C705B358328BE477C581D02DC714', 'x-forwarded-server': 'CODEMONKEY.mydomain.com', 'content-type': 'application/xml'}
2012-06-22 20:23:13-0400 [HTTPChannel,22,127.0.0.1] HTTPB POST :
2012-06-22 20:23:13-0400 [HTTPChannel,22,127.0.0.1]
<body rid='1211827048' xmlns='http://jabber.org/protocol/httpbind' sid='fb03e4779f4b9a4fe15fbf09d5905f455cc54919'>
<iq type='result' to='codemonkey' id='600-864' xmlns='jabber:client'/>
</body>
2012-06-22 20:23:13-0400 [HTTPChannel,22,127.0.0.1] 1211827048
2012-06-22 20:23:13-0400 [HTTPChannel,22,127.0.0.1] This rid is invalid 1211827048 1211827052 ITS INTERNAL RID COUNTER HAS INCREASED TO 52 WHILE WE ARE AT 48.
2012-06-22 20:23:13-0400 [HTTPChannel,22,127.0.0.1] HTTPB Error 404 The tolerance has been exceeded and the connection is closed.
2012-06-22 20:23:13-0400 [HTTPChannel,22,127.0.0.1] 127.0.0.1 - - [23/Jun/2012:00:23:13 +0000] "POST /bosh HTTP/1.1" 404 - "http://172.16.160.246/MySite/Viewers/InteractiveView?programGuideId=486" "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/536.5 (KHTML, like Gecko) Chrome/19.0.1084.56 Safari/536.5"
非常感谢任何帮助。也许我并不完全了解旁遮普正在做什么。在我看来,旁遮普从一个httpbind体内包装的strophe获取BOSH上的信息。它从httpbind主体中提取消息,并通过直接会话将裸消息转发给Openfire。最后,它通过发送一条空的<body xmlns='http://jabber.org/protocol/httpbind'/>
消息来响应strophe,让strophe知道消息已被接收和处理。当消息从Openfire传入时,它们会显示在[XmlStream,client]标头下的日志中,而不是[HTTPChannel,21,127.0.0.1]标头。这些来自Openfire通过直接会话连接,Punjab将它们包装在一个httpbind主体中,并将它们转发到BOSH上以进行扫描。 Strophe然后返回一个空的<body xmlns='http://jabber.org/protocol/httpbind'/>
来确认交易。
为什么旁遮普有时候不承认这个消息呢?为什么它没有看到重复的消息是重复的,只是返回确认而不是重新发送它并错误地递增它的RID计数器?再次,谢谢,谢谢,谢谢你阅读这篇文章。我在我的智慧结束,任何帮助将不胜感激。
以下是失败的完整旁遮普记录:
2012-06-22 20:19:42-0400 [HTTPChannel,22,127.0.0.1] HEADERS 1340410782.18:
2012-06-22 20:19:42-0400 [HTTPChannel,22,127.0.0.1] {'origin': 'http://172.16.160.246', 'content-length': '191', 'accept-language': 'en-US,en;q=0.8', 'accept-encoding': 'gzip,deflate,sdch', 'x-forwarded-host': '172.16.160.246', 'x-forwarded-for': '172.16.122.9', 'host': '127.0.0.1:5280', 'accept': '*/*', 'user-agent':'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/536.5 (KHTML, like Gecko) Chrome/19.0.1084.56 Safari/536.5', 'accept-charset': 'ISO-8859-1,utf-8;q=0.7,*;q=0.3', 'connection': 'Keep-Alive', 'referer': 'http://172.16.160.246/MySite/Viewers/InteractiveView?programGuideId=486', 'cookie': 'ASP.NET_SessionId=c4ioeuw2azw21lkedv0nbwlt; .MySiteUniqueCookie=92416C9E3804DF3F6B5661F5B6447314BA070C1FE9BF3D6830AA256AFFA84CAB691B1E3746DBFD4E99692CC18F831C89810CDF256CD12EAF3EA351FEF240605589BE9AE835B9D862265A1672749B5DF9E7AADEE8BEC95006A410CDA5D25271964C9EE065AB968AB3C9521BC9D1059D545FA40575FB477AC3FFDD4F4A702334D2A83C9C90', 'x-forwarded-server': 'CODEMONKEY.mydomain.com', 'content-type': 'application/xml'}
2012-06-22 20:19:42-0400 [HTTPChannel,22,127.0.0.1] HTTPB POST :
2012-06-22 20:19:42-0400 [HTTPChannel,22,127.0.0.1]
<body rid='1211827046' xmlns='http://jabber.org/protocol/httpbind' sid='fb03e4779f4b9a4fe15fbf09d5905f455cc54919'>
<iq type='result' to='codemonkey' id='511-862' xmlns='jabber:client'/>
</body>
2012-06-22 20:19:42-0400 [HTTPChannel,22,127.0.0.1] 1211827046
2012-06-22 20:19:42-0400 [HTTPChannel,22,127.0.0.1] RETURN HTTPB 1340410782.2:
2012-06-22 20:19:42-0400 [HTTPChannel,22,127.0.0.1]
<body xmlns='http://jabber.org/protocol/httpbind'>
<iq xmlns='jabber:client' from='codemonkey' type='get' id='64-863' to='MySiteadmin@codemonkey/5da9d909-46e0-4dac-8f02-a4113e6490e5'>
<ping xmlns='urn:xmpp:ping'/>
</iq>
</body>
2012-06-22 20:19:42-0400 [HTTPChannel,22,127.0.0.1] 1211827046
2012-06-22 20:19:42-0400 [HTTPChannel,22,127.0.0.1] 127.0.0.1 - - [23/Jun/2012:00:19:42 +0000] "POST /bosh HTTP/1.1" 200 222 "http://172.16.160.246/MySite/Viewers/InteractiveView?programGuideId=486" "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/536.5 (KHTML, like Gecko) Chrome/19.0.1084.56 Safari/536.5"
2012-06-22 20:19:42-0400 [HTTPChannel,22,127.0.0.1] HEADERS 1340410782.34:
2012-06-22 20:19:42-0400 [HTTPChannel,22,127.0.0.1] {'origin': 'http://172.16.160.246', 'content-length': '190', 'accept-language': 'en-US,en;q=0.8', 'accept-encoding': 'gzip,deflate,sdch', 'x-forwarded-host': '172.16.160.246', 'x-forwarded-for': '172.16.122.9', 'host': '127.0.0.1:5280', 'accept': '*/*', 'user-agent':'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/536.5 (KHTML, like Gecko) Chrome/19.0.1084.56 Safari/536.5', 'accept-charset': 'ISO-8859-1,utf-8;q=0.7,*;q=0.3', 'connection': 'Keep-Alive', 'referer': 'http://172.16.160.246/MySite/Viewers/InteractiveView?programGuideId=486', 'cookie': 'ASP.NET_SessionId=c4ioeuw2azw21lkedv0nbwlt; .MySiteUniqueCookie=92416C9E3804DF3F6B5661F5B6447314BA070C1FE9BF3D6830AA256AFFA84CAB691B1E3746DBFD4E99692CC18F831C89810CDF256CD12EAF3EA351FEF240605589BE9AE835B9D862265A1672749B5DF9E7AADEE8BEC95006A410CDA5D25271964C9EE065AB968AB3C9521BC9D1059D545FA40575FB477AC3FFDD4F4A702334D2A83C9C90', 'x-forwarded-server': 'CODEMONKEY.mydomain.com', 'content-type': 'application/xml'}
2012-06-22 20:19:42-0400 [HTTPChannel,22,127.0.0.1] HTTPB POST :
2012-06-22 20:19:42-0400 [HTTPChannel,22,127.0.0.1]
<body rid='1211827047' xmlns='http://jabber.org/protocol/httpbind' sid='fb03e4779f4b9a4fe15fbf09d5905f455cc54919'>
<iq type='result' to='codemonkey' id='64-863' xmlns='jabber:client'/>
</body>
2012-06-22 20:19:42-0400 [HTTPChannel,22,127.0.0.1] 1211827047
2012-06-22 20:19:42-0400 [HTTPChannel,22,127.0.0.1]
SID: fb03e4779f4b9a4fe15fbf09d5905f455cc54919 =>
SEND: "
<iq xmlns='jabber:client' to='codemonkey' type='result' id='64-863'/>"
2012-06-22 20:20:50-0400 [HTTPChannel,21,127.0.0.1] HEADERS 1340410850.19:
2012-06-22 20:20:50-0400 [HTTPChannel,21,127.0.0.1] {'origin': 'http://172.16.160.246', 'content-length': '190', 'accept-language': 'en-US,en;q=0.8', 'accept-encoding': 'gzip,deflate,sdch', 'x-forwarded-host': '172.16.160.246', 'x-forwarded-for': '172.16.122.9', 'host': '127.0.0.1:5280', 'accept': '*/*', 'user-agent':'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/536.5 (KHTML, like Gecko) Chrome/19.0.1084.56 Safari/536.5', 'accept-charset': 'ISO-8859-1,utf-8;q=0.7,*;q=0.3', 'connection': 'Keep-Alive', 'referer': 'http://172.16.160.246/MySite/Viewers/InteractiveView?programGuideId=486', 'cookie': 'ASP.NET_SessionId=c4ioeuw2azw21lkedv0nbwlt; .MySiteUniqueCookie=0772CAEB889BB1F853371E4153AC6972595A3A548BAE87D3F8D86AFBB5B88B4C0B8FD61F971816D4678388499B0A71E2517048261B07AD393D9EECDA199FA7EA51CBCD17299047473C6B9A9667BAF9367059319B4F0292B57238A0E2DB2AC737B12E530EAAE85732B1070E1F563E7675A82DF41C57A2C705B358328BE477C581D02DC714', 'x-forwarded-server': 'CODEMONKEY.mydomain.com', 'content-type': 'application/xml'}
2012-06-22 20:20:50-0400 [HTTPChannel,21,127.0.0.1] HTTPB POST :
2012-06-22 20:20:50-0400 [HTTPChannel,21,127.0.0.1]
<body rid='1211827047' xmlns='http://jabber.org/protocol/httpbind' sid='fb03e4779f4b9a4fe15fbf09d5905f455cc54919'>
<iq type='result' to='codemonkey' id='64-863' xmlns='jabber:client'/>
</body>
2012-06-22 20:20:50-0400 [HTTPChannel,21,127.0.0.1] 1211827047
2012-06-22 20:20:50-0400 [HTTPChannel,21,127.0.0.1]
SID: fb03e4779f4b9a4fe15fbf09d5905f455cc54919 =>
SEND: "
<iq xmlns='jabber:client' to='codemonkey' type='result' id='64-863'/>"
2012-06-22 20:20:50-0400 [HTTPChannel,21,127.0.0.1] RETURN HTTPB 1340410850.21:
2012-06-22 20:20:50-0400 [HTTPChannel,21,127.0.0.1]
<body xmlns='http://jabber.org/protocol/httpbind'/>
2012-06-22 20:20:50-0400 [HTTPChannel,21,127.0.0.1] 1211827047
2012-06-22 20:20:50-0400 [HTTPChannel,21,127.0.0.1] 127.0.0.1 - - [23/Jun/2012:00:20:49 +0000] "POST /bosh HTTP/1.1" 200 51 "http://172.16.160.246/MySite/Viewers/InteractiveView?programGuideId=486" "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/536.5 (KHTML, like Gecko) Chrome/19.0.1084.56 Safari/536.5"
2012-06-22 20:22:00-0400 [XmlStream,client]
SID: fb03e4779f4b9a4fe15fbf09d5905f455cc54919 =>
RECV: '
<iq type="get" id="600-864" from="codemonkey" to="MySiteadmin@codemonkey/5da9d909-46e0-4dac-8f02-a4113e6490e5">
<ping xmlns="urn:xmpp:ping"/>
</iq>'
2012-06-22 20:22:00-0400 [XmlStream,client] RETURN HTTPB 1340410920.62:
2012-06-22 20:22:00-0400 [XmlStream,client]
<body xmlns='http://jabber.org/protocol/httpbind'>
<iq xmlns='jabber:client' from='codemonkey' type='get' id='600-864' to='MySiteadmin@codemonkey/5da9d909-46e0-4dac-8f02-a4113e6490e5'>
<ping xmlns='urn:xmpp:ping'/>
</iq>
</body>
2012-06-22 20:22:00-0400 [XmlStream,client] 1211827047
2012-06-22 20:22:00-0400 [XmlStream,client] 127.0.0.1 - - [23/Jun/2012:00:21:59+0000] "POST /bosh HTTP/1.1" 200 223 "http://172.16.160.246/MySite/Viewers/InteractiveView?programGuideId=486" "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/536.5 (KHTML, like Gecko) Chrome/19.0.1084.56 Safari/536.5"
2012-06-22 20:22:07-0400 [HTTPChannel,21,127.0.0.1] HEADERS 1340410927.48:
2012-06-22 20:22:07-0400 [HTTPChannel,21,127.0.0.1] {'origin': 'http://172.16.160.246', 'content-length': '190', 'accept-language': 'en-US,en;q=0.8', 'accept-encoding': 'gzip,deflate,sdch', 'x-forwarded-host': '172.16.160.246', 'x-forwarded-for': '172.16.122.9', 'host': '127.0.0.1:5280', 'accept': '*/*', 'user-agent':'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/536.5 (KHTML, like Gecko) Chrome/19.0.1084.56 Safari/536.5', 'accept-charset': 'ISO-8859-1,utf-8;q=0.7,*;q=0.3', 'connection': 'Keep-Alive', 'referer': 'http://172.16.160.246/MySite/Viewers/InteractiveView?programGuideId=486', 'cookie': 'ASP.NET_SessionId=c4ioeuw2azw21lkedv0nbwlt; .MySiteUniqueCookie=0772CAEB889BB1F853371E4153AC6972595A3A548BAE87D3F8D86AFBB5B88B4C0B8FD61F971816D4678388499B0A71E2517048261B07AD393D9EECDA199FA7EA51CBCD17299047473C6B9A9667BAF9367059319B4F0292B57238A0E2DB2AC737B12E530EAAE85732B1070E1F563E7675A82DF41C57A2C705B358328BE477C581D02DC714', 'x-forwarded-server': 'CODEMONKEY.mydomain.com', 'content-type': 'application/xml'}
2012-06-22 20:22:07-0400 [HTTPChannel,21,127.0.0.1] HTTPB POST :
2012-06-22 20:22:07-0400 [HTTPChannel,21,127.0.0.1]
<body rid='1211827047' xmlns='http://jabber.org/protocol/httpbind' sid='fb03e4779f4b9a4fe15fbf09d5905f455cc54919'>
<iq type='result' to='codemonkey' id='64-863' xmlns='jabber:client'/>
</body>
2012-06-22 20:22:07-0400 [HTTPChannel,21,127.0.0.1] 1211827047
2012-06-22 20:22:07-0400 [HTTPChannel,21,127.0.0.1] RETURN HTTPB 1340410927.48:
2012-06-22 20:22:07-0400 [HTTPChannel,21,127.0.0.1]
<body xmlns='http://jabber.org/protocol/httpbind'>
<iq xmlns='jabber:client' from='codemonkey' type='get' id='600-864' to='MySiteadmin@codemonkey/5da9d909-46e0-4dac-8f02-a4113e6490e5'>
<pingxmlns='urn:xmpp:ping'/>
</iq>
</body>
2012-06-22 20:22:07-0400 [HTTPChannel,21,127.0.0.1] 1211827047
2012-06-22 20:22:07-0400 [HTTPChannel,21,127.0.0.1] 127.0.0.1 - - [23/Jun/2012:00:22:06 +0000] "POST /bosh HTTP/1.1" 200 223 "http://172.16.160.246/MySite/Viewers/InteractiveView?programGuideId=486" "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/536.5 (KHTML, like Gecko) Chrome/19.0.1084.56 Safari/536.5"
2012-06-22 20:22:07-0400 [HTTPChannel,21,127.0.0.1] HEADERS 1340410927.67:
2012-06-22 20:22:07-0400 [HTTPChannel,21,127.0.0.1] {'origin': 'http://172.16.160.246', 'content-length': '191', 'accept-language': 'en-US,en;q=0.8', 'accept-encoding': 'gzip,deflate,sdch', 'x-forwarded-host': '172.16.160.246', 'x-forwarded-for': '172.16.122.9', 'host': '127.0.0.1:5280', 'accept': '*/*', 'user-agent':'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/536.5 (KHTML, like Gecko) Chrome/19.0.1084.56 Safari/536.5', 'accept-charset': 'ISO-8859-1,utf-8;q=0.7,*;q=0.3', 'connection': 'Keep-Alive', 'referer': 'http://172.16.160.246/MySite/Viewers/InteractiveView?programGuideId=486', 'cookie': 'ASP.NET_SessionId=c4ioeuw2azw21lkedv0nbwlt; .MySiteUniqueCookie=0772CAEB889BB1F853371E4153AC6972595A3A548BAE87D3F8D86AFBB5B88B4C0B8FD61F971816D4678388499B0A71E2517048261B07AD393D9EECDA199FA7EA51CBCD17299047473C6B9A9667BAF9367059319B4F0292B57238A0E2DB2AC737B12E530EAAE85732B1070E1F563E7675A82DF41C57A2C705B358328BE477C581D02DC714', 'x-forwarded-server': 'CODEMONKEY.mydomain.com', 'content-type': 'application/xml'}
2012-06-22 20:22:07-0400 [HTTPChannel,21,127.0.0.1] HTTPB POST :
2012-06-22 20:22:07-0400 [HTTPChannel,21,127.0.0.1]
<body rid='1211827048' xmlns='http://jabber.org/protocol/httpbind' sid='fb03e4779f4b9a4fe15fbf09d5905f455cc54919'>
<iq type='result' to='codemonkey' id='600-864' xmlns='jabber:client'/>
</body>
2012-06-22 20:22:07-0400 [HTTPChannel,21,127.0.0.1] 1211827048
2012-06-22 20:22:07-0400 [HTTPChannel,21,127.0.0.1]
SID: fb03e4779f4b9a4fe15fbf09d5905f455cc54919 =>
SEND: "
<iq xmlns='jabber:client' to='codemonkey' type='result' id='600-864'/>"
2012-06-22 20:22:12-0400 [-]
SID: fb03e4779f4b9a4fe15fbf09d5905f455cc54919 =>
SEND: ' '
2012-06-22 20:23:13-0400 [HTTPChannel,22,127.0.0.1] HEADERS 1340410993.78:
2012-06-22 20:23:13-0400 [HTTPChannel,22,127.0.0.1] {'origin': 'http://172.16.160.246', 'content-length': '191', 'accept-language': 'en-US,en;q=0.8', 'accept-encoding': 'gzip,deflate,sdch', 'x-forwarded-host': '172.16.160.246', 'x-forwarded-for': '172.16.122.9', 'host': '127.0.0.1:5280', 'accept': '*/*', 'user-agent':'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/536.5 (KHTML, like Gecko) Chrome/19.0.1084.56 Safari/536.5', 'accept-charset': 'ISO-8859-1,utf-8;q=0.7,*;q=0.3', 'connection': 'Keep-Alive', 'referer': 'http://172.16.160.246/MySite/Viewers/InteractiveView?programGuideId=486', 'cookie': 'ASP.NET_SessionId=c4ioeuw2azw21lkedv0nbwlt; .MySiteUniqueCookie=0772CAEB889BB1F853371E4153AC6972595A3A548BAE87D3F8D86AFBB5B88B4C0B8FD61F971816D4678388499B0A71E2517048261B07AD393D9EECDA199FA7EA51CBCD17299047473C6B9A9667BAF9367059319B4F0292B57238A0E2DB2AC737B12E530EAAE85732B1070E1F563E7675A82DF41C57A2C705B358328BE477C581D02DC714', 'x-forwarded-server': 'CODEMONKEY.mydomain.com', 'content-type': 'application/xml'}
2012-06-22 20:23:13-0400 [HTTPChannel,22,127.0.0.1] HTTPB POST :
2012-06-22 20:23:13-0400 [HTTPChannel,22,127.0.0.1]
<body rid='1211827048' xmlns='http://jabber.org/protocol/httpbind' sid='fb03e4779f4b9a4fe15fbf09d5905f455cc54919'>
<iq type='result' to='codemonkey' id='600-864' xmlns='jabber:client'/>
</body>
2012-06-22 20:23:13-0400 [HTTPChannel,22,127.0.0.1] 1211827048
2012-06-22 20:23:13-0400 [HTTPChannel,22,127.0.0.1] This rid is invalid 1211827048 1211827052
2012-06-22 20:23:13-0400 [HTTPChannel,22,127.0.0.1] HTTPB Error 404
2012-06-22 20:23:13-0400 [HTTPChannel,22,127.0.0.1] 127.0.0.1 - - [23/Jun/2012:00:23:13 +0000] "POST /bosh HTTP/1.1" 404 - "http://172.16.160.246/MySite/Viewers/InteractiveView?programGuideId=486" "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/536.5 (KHTML, like Gecko) Chrome/19.0.1084.56 Safari/536.5"
2012-06-22 20:23:23-0400 [XmlStream,client]
SID: fb03e4779f4b9a4fe15fbf09d5905f455cc54919 =>
RECV: '
<iq type="get" id="180-865" from="codemonkey" to="MySiteadmin@codemonkey/5da9d909-46e0-4dac-8f02-a4113e6490e5">
<ping xmlns="urn:xmpp:ping"/>
</iq>'
2012-06-22 20:23:23-0400 [XmlStream,client] RETURN HTTPB 1340411003.49:
2012-06-22 20:23:23-0400 [XmlStream,client]
<body xmlns='http://jabber.org/protocol/httpbind'>
<iq xmlns='jabber:client' from='codemonkey' type='get' id='180-865' to='MySiteadmin@codemonkey/5da9d909-46e0-4dac-8f02-a4113e6490e5'>
<ping xmlns='urn:xmpp:ping'/>
</iq>
</body>
2012-06-22 20:23:23-0400 [XmlStream,client] 1211827048
2012-06-22 20:23:23-0400 [XmlStream,client] 127.0.0.1 - - [23/Jun/2012:00:23:23+0000] "POST /bosh HTTP/1.1" 200 223 "http://172.16.160.246/MySite/Viewers/InteractiveView?programGuideId=486" "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/536.5 (KHTML, like Gecko) Chrome/19.0.1084.56 Safari/536.5"
答案 0 :(得分:0)
事实证明,我对旁遮普的理解是有缺陷的。空<body xmlns='http://jabber.org/protocol/httpbind'/>
消息实际上不用于通过BOSH连接确认消息。由于BOSH使用长轮询技术,客户端使用空的httpbind主体初始化连接。服务器在指定的等待时间内保持此连接打开 - 即60秒。如果该60秒标记没有收到任何消息,则服务器通过响应空的httpbind主体来关闭连接,并且客户端通过向服务器发送另一个空主体来重新打开新的连接。
我的问题源于我使用MatriX库初始化C#中的预绑定连接。连接保持打开的默认等待时间为300秒。因此,它建立与旁遮普的连接以在300秒后关闭连接。但是,strophe的默认等待时间是60秒。当我用strophe附加到现有的MatriX连接时,strophe变得困惑,因为旁遮普没有像预期的那样在60秒内释放连接。
修复是将strophe等待时间更改为300秒以匹配MatriX设置条件。