旁遮普邦并不始终承认它正在从 strophe 获取消息

Posted

技术标签:

【中文标题】旁遮普邦并不始终承认它正在从 strophe 获取消息【英文标题】:Punjab does not consistently acknowledge that it is getting messages from strophe 【发布时间】:2012-06-24 03:41:55 【问题描述】:

首先,提前感谢您和我一起研究这个问题。

我目前正在使用 strophe.js 通过 BOSH 连接连接到旁遮普邦,最终将消息转发到 Openfire。我在服务器上预绑定并附加到与 strophe 的连接。这最初工作正常;我可以发送和接收消息,当我收到空闲 ping 时,我能够成功响应。但是,一段时间后,我的连接断开了。

检查旁遮普日志后,当我从 strophe 发送消息时,似乎并不总是从旁遮普得到 httpbind 确认。 Strophe 按预期等待大约 60 秒,然后尝试再次发送消息 - 具有相同 ID 的完整副本。这是有道理的,因为它不知道旁遮普是否曾经收到过这条消息,因为它从未承认过。然而,由于某种原因,旁遮普省收到了这条重复消息,并认为它是一个带有不正确 RID 的新消息,因此它增加了它的内部 RID 计数器,就像它会增加任何其他消息一样。此外,它再次将消息转发到 Openfire 服务器,尽管据我所知,我还没有看到这有任何显着影响。最后,在这种情况发生多次后,Strophe 使用的 RID 超出了 RID 容差窗口,Punjab 返回 404 Not Found 错误,并最终关闭连接。

我的问题是,为什么旁遮普邦没有按应有的方式确认某些消息 - 将 <body xmlns='http://jabber.org/protocol/httpbind'/> 返回到 strophe。

以下日志中的示例详细说明了此过程:

    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"

任何帮助将不胜感激。也许我不完全理解旁遮普在做什么。在我看来,旁遮普邦通过 BOSH 从打包在 httpbind 正文中的 strophe 获取消息。它从 httpbind 正文中提取消息并通过直接会话将裸消息转发给 Openfire。最后,它通过返回一个裸露的&lt;body xmlns='http://jabber.org/protocol/httpbind'/&gt; 消息来响应 strophe,让 strophe 知道该消息已被接收并处理。当消息来自 Openfire 时,它​​们会显示在 [XmlStream,client] 标头下的日志中,而不是 [HTTPChannel,21,127.0.0.1] 标头下。这些来自 Openfire 通过直接会话连接,Punjab 将它们包装在 httpbind 主体中,然后通过 BOSH 将它们转发到 strophe。 Strophe 然后返回一个空的&lt;body xmlns='http://jabber.org/protocol/httpbind'/&gt; 确认交易。

那么为什么旁遮普邦有时无法确认消息?为什么它没有将重复消息视为重复消息而只是返回确认而不是重新发送它并错误地增加它的 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"

【问题讨论】:

如果我缺少信息或者是否有众所周知的资源可以找到相关信息,请告诉我。无可否认,我对旁遮普邦和 XMPP 整体来说有些陌生,但我已经用尽了我的 google-fu 和所有我能想到的资源。 【参考方案1】:

事实证明,我对旁遮普的理解是有缺陷的。空的&lt;body xmlns='http://jabber.org/protocol/httpbind'/&gt; 消息实际上并不是用于通过 BOSH 连接确认消息。由于 BOSH 使用长轮询技术,客户端使用空的 httpbind 主体初始化连接。服务器在指定的等待时间内保持此连接打开 - 即 60 秒。如果在该 60 秒标记之前没有收到任何消息,则服务器通过以空的 httpbind 正文进行响应来关闭连接,并且客户端通过向服务器发送另一个空正文来重新打开一个新的连接。

我的问题源于我在 C# 中使用 MatriX 库初始化预绑定连接。连接保持打开的默认 等待 时间为 300 秒。因此,它会建立与旁遮普语的连接以在 300 秒后关闭连接。但是,strophe 的默认 等待 时间是 60 秒。当我使用 strophe 附加到现有的 MatriX 连接时,strophe 变得混乱,因为旁遮普语没有像预期的那样在 60 秒内释放连接。

修复方法是将 strophe 等待时间更改为 300 秒以匹配 MatriX 设置条件。

【讨论】:

以上是关于旁遮普邦并不始终承认它正在从 strophe 获取消息的主要内容,如果未能解决你的问题,请参考以下文章

Strophe 无法通过 BOSH 服务器连接到 Facebook

可以使用 Strophe 在 java(jvm) 上与 Bosh Manager 建立 Bosh 连接吗?

使用 strophe 获取在线用户列表 xmpp [关闭]

将旁遮普语文本转换为英文文本

如何让旁遮普语/扭曲绕过 dns

xmpp openfire 未验证我稍后用于 strophe 附加的 php 脚本