Javascript Ejabberd在可用状态后关闭波什会话

Javascript Ejabberd在可用状态后关闭波什会话,javascript,erlang,xmpp,ejabberd,jsjac,Javascript,Erlang,Xmpp,Ejabberd,Jsjac,我不明白为什么Ejabberd 14.07和14.12在收到同一个会话的“可用”小节后关闭了一个波什会话 我使用JsJac作为web客户端库,会话被预先绑定到服务器端,JsJac在第一页加载时执行“继承”,在重新启动时执行als。发生这种情况的场景是在成功连接和聊天之后,我使用chrome开发者工具禁用网络连接 Ejabberd每15秒ping一次,并在超时时设置为“kill”。ejabberd.yml中BOSH的非活动超时设置为480 然后,用户可以单击链接尝试重新连接。这是调用与初始预绑定+

我不明白为什么Ejabberd 14.07和14.12在收到同一个会话的“可用”小节后关闭了一个波什会话

我使用JsJac作为web客户端库,会话被预先绑定到服务器端,JsJac在第一页加载时执行“继承”,在重新启动时执行als。发生这种情况的场景是在成功连接和聊天之后,我使用chrome开发者工具禁用网络连接

Ejabberd每15秒ping一次,并在超时时设置为“kill”。ejabberd.yml中BOSH的非活动超时设置为480

然后,用户可以单击链接尝试重新连接。这是调用与初始预绑定+客户端继承完全相同的函数。在看似成功的重新连接后,几秒钟后,这:

非公开会议 匿名的c6502a950667fc79c3e1534559cc02e0@localhost/7f317c7fcbb9fb1b79c414c2d8afe05c

出现在ejabberd日志中,并向聊天中的另一方发送一段不可用信息

问:有人知道波什会议为什么会结束吗

这是Ejabberd日志的相关部分

2015-01-09 18:25:21.308 [debug] <0.2710.0>@ejabberd_receiver:process_data:343 Received XML on stream = <<"<presence from=\"anonymous.c6502a950667fc79c3e1534559cc02e0@jaxlecho.localhost\" type=\"available\"/>">>
2015-01-09 18:25:21.309 [debug] <0.2710.0>@shaper:update:117 State: {maxrate,50000,1899.4311619841992,1420824321273332}, Size=97
M=0.9887812185897407, I=35.836
2015-01-09 18:25:21.390 [info] <0.2709.0>@ejabberd_listener:accept:313 (#Port<0.41723>) Accepted connection ::FFFF:127.0.0.1:58483 -> ::FFFF:127.0.0.1:5280
2015-01-09 18:25:21.391 [debug] <0.5331.0>@ejabberd_http:init:145 S: [{[<<"presence">>],mod_webpresence},{[<<"captcha">>],ejabberd_captcha},{[<<"admin">>],ejabberd_web_admin},{[<<"http-bind">>],mod_http_bind},{[<<"http-poll">>],ejabberd_http_poll}]
2015-01-09 18:25:21.391 [info] <0.5331.0>@ejabberd_http:init:149 started: {gen_tcp,#Port<0.41723>}
2015-01-09 18:25:21.392 [debug] <0.5331.0>@ejabberd_http:process_header:277 (#Port<0.41723>) http query: 'POST' /http-bind
2015-01-09 18:25:21.392 [debug] <0.5331.0>@ejabberd_http:process_request:438 client data: <<"<body rid='876185' sid='a1e29cded4325f591bdc5b3646a8f3c78553cdd8' xmlns='http://jabber.org/protocol/httpbind' key='38516e6b293e317ee957f6ef74fa23c68a003d19'/>">>
2015-01-09 18:25:21.392 [debug] <0.5331.0>@ejabberd_http:process:350 [<<"http-bind">>] matches [<<"http-bind">>]
2015-01-09 18:25:21.393 [debug] <0.5331.0>@ejabberd_http:process:354 [{'Accept-Language',<<"en-US,en;q=0.8,es;q=0.6,und;q=0.4,nl;q=0.2,ca;q=0.2">>},{'Accept-Encoding',<<"gzip, deflate">>},{'Referer',<<"http://localhost:9080/">>},{'Accept',<<"*/*">>},{'Content-Type',<<"text/xml; charset=UTF-8">>},{'User-Agent',<<"Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/39.0.2171.95 Safari/537.36">>},{<<"Origin">>,<<"http://localhost:9080">>},{'Content-Length',<<"158">>},{'Connection',<<"close">>},{'Host',<<"vagrant.localhost">>}]
2015-01-09 18:25:21.393 [debug] <0.5331.0>@mod_http_bind:process:68 Incoming data: <body rid='876185' sid='a1e29cded4325f591bdc5b3646a8f3c78553cdd8' xmlns='http://jabber.org/protocol/httpbind' key='38516e6b293e317ee957f6ef74fa23c68a003d19'/>
2015-01-09 18:25:21.393 [debug] <0.5331.0>@ejabberd_http_bind:parse_request:1128 --- incoming data --- 
<body rid='876185' sid='a1e29cded4325f591bdc5b3646a8f3c78553cdd8' xmlns='http://jabber.org/protocol/httpbind' key='38516e6b293e317ee957f6ef74fa23c68a003d19'/>
 --- END --- 
2015-01-09 18:25:21.394 [debug] <0.5331.0>@ejabberd_http_bind:http_put:792 Looking for session: <<"a1e29cded4325f591bdc5b3646a8f3c78553cdd8">>
2015-01-09 18:25:21.394 [debug] <0.4052.0>@ejabberd_http_bind:handle_sync_event:440 New request: {http_put,876185,[{<<"xmlns">>,<<"http://jabber.org/protocol/httpbind">>},{<<"rid">>,<<"876185">>},{<<"sid">>,<<"a1e29cded4325f591bdc5b3646a8f3c78553cdd8">>},{<<"key">>,<<"38516e6b293e317ee957f6ef74fa23c68a003d19">>}],[],158,1,<<>>,{{0,0,0,0,0,65535,32512,1},58483}}
2015-01-09 18:25:21.395 [debug] <0.4052.0>@ejabberd_http_bind:handle_http_put_event:575 New request: {http_put,876185,[{<<"xmlns">>,<<"http://jabber.org/protocol/httpbind">>},{<<"rid">>,<<"876185">>},{<<"sid">>,<<"a1e29cded4325f591bdc5b3646a8f3c78553cdd8">>},{<<"key">>,<<"38516e6b293e317ee957f6ef74fa23c68a003d19">>}],[],158,1,<<>>,{{0,0,0,0,0,65535,32512,1},58483}}
2015-01-09 18:25:21.395 [debug] <0.4052.0>@ejabberd_http_bind:rid_allow:866 Previous rid / New rid: 876184/876185
2015-01-09 18:25:21.396 [debug] <0.4052.0>@ejabberd_http_bind:process_http_put:608 Actually processing request: {http_put,876185,[{<<"xmlns">>,<<"http://jabber.org/protocol/httpbind">>},{<<"rid">>,<<"876185">>},{<<"sid">>,<<"a1e29cded4325f591bdc5b3646a8f3c78553cdd8">>},{<<"key">>,<<"38516e6b293e317ee957f6ef74fa23c68a003d19">>}],[],158,1,<<>>,{{0,0,0,0,0,65535,32512,1},58483}}
2015-01-09 18:25:21.396 [debug] <0.4052.0>@ejabberd_http_bind:process_http_put:619 Key/OldKey/NextKey: 38516e6b293e317ee957f6ef74fa23c68a003d19/85e12ff1c2c9590328a5f0a1e58c14e52a8c6c42/85e12ff1c2c9590328a5f0a1e58c14e52a8c6c42
2015-01-09 18:25:21.397 [debug] <0.4052.0>@ejabberd_http_bind:process_http_put:659  -- SaveKey: 38516e6b293e317ee957f6ef74fa23c68a003d19
2015-01-09 18:25:21.397 [debug] <0.4052.0>@ejabberd_http_bind:process_http_put:671 reqlist: [{hbr,876185,<<"85e12ff1c2c9590328a5f0a1e58c14e52a8c6c42">>,[]},{hbr,876184,<<"85e12ff1c2c9590328a5f0a1e58c14e52a8c6c42">>,[{xmlstreamelement,{xmlel,<<"presence">>,[{<<"from">>,<<"anonymous.c6502a950667fc79c3e1534559cc02e0@jaxlecho.localhost">>},{<<"to">>,<<"agent1@localhost/cb_operator_1420818758533">>},{<<"type">>,<<"available">>},{<<"show">>,<<"chat">>}],[]}}]}]
2015-01-09 18:25:21.398 [debug] <0.4052.0>@ejabberd_http_bind:process_http_put:717 really sending now: []
2015-01-09 18:25:31.193 [debug] <0.2648.0>@ejabberd_router:do_route:322 route
    from {jid,<<>>,<<"localhost">>,<<>>,<<>>,<<"localhost">>,<<>>}
    to {jid,<<"agent1">>,<<"localhost">>,<<"cb_operator_1420818758533">>,<<"agent1">>,<<"localhost">>,<<"cb_operator_1420818758533">>}
    packet {xmlel,<<"iq">>,[{<<"id">>,<<"4293567110">>},{<<"type">>,<<"get">>}],[{xmlel,<<"ping">>,[{<<"xmlns">>,<<"urn:xmpp:ping">>}],[]}]}
2015-01-09 18:25:31.194 [debug] <0.2648.0>@ejabberd_local:do_route:296 local route
    from {jid,<<>>,<<"localhost">>,<<>>,<<>>,<<"localhost">>,<<>>}
    to {jid,<<"agent1">>,<<"localhost">>,<<"cb_operator_1420818758533">>,<<"agent1">>,<<"localhost">>,<<"cb_operator_1420818758533">>}
    packet {xmlel,<<"iq">>,[{<<"id">>,<<"4293"...>>},{<<"type">>,<<...>>}],[{xmlel,<<...>>,...}]}
2015-01-09 18:25:31.194 [debug] <0.2648.0>@ejabberd_sm:do_route:514 session manager
    from {jid,<<>>,<<"localhost">>,<<>>,<<>>,<<"localhost">>,<<>>}
    to {jid,<<"agent1">>,<<"localhost">>,<<"cb_operator_1420818758533">>,<<"agent1">>,<<"localhost">>,<<"cb_operator_1420818758533">>}
    packet {xmlel,<<"iq">>,[{<<"id">>,<<"4293"...>>},{<<"type">>,<<...>>}],[{xmlel,<<...>>,...}]}
2015-01-09 18:25:31.194 [debug] <0.2648.0>@ejabberd_sm:do_route:612 sending to process <0.4053.0>
2015-01-09 18:25:31.195 [debug] <0.5331.0>@ejabberd_http_bind:prepare_response:914 OutPacket: [{xmlstreamelement,{xmlel,<<"iq">>,[{<<"from">>,<<"localhost">>},{<<"to">>,<<"agent1@localhost/cb_operator_1420818758533">>},{<<"id">>,<<"4293567110">>},{<<"type">>,<<"get">>}],[{xmlel,<<"ping">>,[{<<"xmlns">>,<<"urn:xmpp:ping">>}],[]}]}}]
2015-01-09 18:25:31.195 [debug] <0.5331.0>@ejabberd_http_bind:send_outpacket:1056  --- outgoing data --- 
<body xmlns='http://jabber.org/protocol/httpbind'><iq xmlns='jabber:client' from='localhost' to='agent1@localhost/cb_operator_1420818758533' id='4293567110' type='get'><ping xmlns='urn:xmpp:ping'/></iq></body>
 --- END --- 
2015-01-09 18:25:31.228 [info] <0.2709.0>@ejabberd_listener:accept:313 (#Port<0.41753>) Accepted connection ::FFFF:127.0.0.1:58484 -> ::FFFF:127.0.0.1:5280
2015-01-09 18:25:31.230 [debug] <0.5332.0>@ejabberd_http:init:145 S: [{[<<"presence">>],mod_webpresence},{[<<"captcha">>],ejabberd_captcha},{[<<"admin">>],ejabberd_web_admin},{[<<"http-bind">>],mod_http_bind},{[<<"http-poll">>],ejabberd_http_poll}]
2015-01-09 18:25:31.231 [info] <0.5332.0>@ejabberd_http:init:149 started: {gen_tcp,#Port<0.41753>}
2015-01-09 18:25:31.231 [debug] <0.5332.0>@ejabberd_http:process_header:277 (#Port<0.41753>) http query: 'POST' /http-bind
2015-01-09 18:25:31.231 [debug] <0.5332.0>@ejabberd_http:process_request:438 client data: <<"<body rid='876186' sid='a1e29cded4325f591bdc5b3646a8f3c78553cdd8' xmlns='http://jabber.org/protocol/httpbind' key='9cffab80935471f419ce5c9201475df5935108d5'><iq xmlns=\"jabber:client\" to=\"localhost\" id=\"4293567110\" type=\"result\"><ping xmlns=\"urn:xmpp:ping\"/></iq></body>">>
2015-01-09 18:25:31.231 [debug] <0.5332.0>@ejabberd_http:process:350 [<<"http-bind">>] matches [<<"http-bind">>]
2015-01-09 18:25:31.232 [debug] <0.5332.0>@ejabberd_http:process:354 [{'Accept-Language',<<"en-US,en;q=0.8,es;q=0.6,und;q=0.4,nl;q=0.2,ca;q=0.2">>},{'Accept-Encoding',<<"gzip, deflate">>},{'Referer',<<"http://localhost:9080/">>},{'Accept',<<"*/*">>},{'Content-Type',<<"text/xml; charset=UTF-8">>},{'User-Agent',<<"Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/39.0.2171.95 Safari/537.36">>},{<<"Origin">>,<<"http://localhost:9080">>},{'Content-Length',<<"269">>},{'Connection',<<"close">>},{'Host',<<"vagrant.localhost">>}]
2015-01-09 18:25:31.233 [debug] <0.5332.0>@mod_http_bind:process:68 Incoming data: <body rid='876186' sid='a1e29cded4325f591bdc5b3646a8f3c78553cdd8' xmlns='http://jabber.org/protocol/httpbind' key='9cffab80935471f419ce5c9201475df5935108d5'><iq xmlns="jabber:client" to="localhost" id="4293567110" type="result"><ping xmlns="urn:xmpp:ping"/></iq></body>
2015-01-09 18:25:31.233 [debug] <0.5332.0>@ejabberd_http_bind:parse_request:1128 --- incoming data --- 
<body rid='876186' sid='a1e29cded4325f591bdc5b3646a8f3c78553cdd8' xmlns='http://jabber.org/protocol/httpbind' key='9cffab80935471f419ce5c9201475df5935108d5'><iq xmlns="jabber:client" to="localhost" id="4293567110" type="result"><ping xmlns="urn:xmpp:ping"/></iq></body>
 --- END --- 
2015-01-09 18:25:31.234 [debug] <0.5332.0>@ejabberd_http_bind:http_put:792 Looking for session: <<"a1e29cded4325f591bdc5b3646a8f3c78553cdd8">>
2015-01-09 18:25:31.234 [debug] <0.4052.0>@ejabberd_http_bind:handle_sync_event:440 New request: {http_put,876186,[{<<"xmlns">>,<<"http://jabber.org/protocol/httpbind">>},{<<"rid">>,<<"876186">>},{<<"sid">>,<<"a1e29cded4325f591bdc5b3646a8f3c78553cdd8">>},{<<"key">>,<<"9cffab80935471f419ce5c9201475df5935108d5">>}],[{xmlel,<<"iq">>,[{<<"xmlns">>,<<"jabber:client">>},{<<"to">>,<<"localhost">>},{<<"id">>,<<"4293567110">>},{<<"type">>,<<"result">>}],[{xmlel,<<"ping">>,[{<<"xmlns">>,<<"urn:xmpp:ping">>}],[]}]}],269,1,<<>>,{{0,0,0,0,0,65535,32512,1},58484}}
2015-01-09 18:25:31.234 [debug] <0.4052.0>@ejabberd_http_bind:handle_http_put_event:575 New request: {http_put,876186,[{<<"xmlns">>,<<"http://jabber.org/protocol/httpbind">>},{<<"rid">>,<<"876186">>},{<<"sid">>,<<"a1e29cded4325f591bdc5b3646a8f3c78553cdd8">>},{<<"key">>,<<"9cffab80935471f419ce5c9201475df5935108d5">>}],[{xmlel,<<"iq">>,[{<<"xmlns">>,<<"jabber:client">>},{<<"to">>,<<"localhost">>},{<<"id">>,<<"4293567110">>},{<<"type">>,<<"result">>}],[{xmlel,<<"ping">>,[{<<"xmlns">>,<<"urn:xmpp:ping">>}],[]}]}],269,1,<<>>,{{0,0,0,0,0,65535,32512,1},58484}}
2015-01-09 18:25:31.234 [debug] <0.4052.0>@ejabberd_http_bind:rid_allow:866 Previous rid / New rid: 876185/876186
2015-01-09 18:25:31.234 [debug] <0.4052.0>@ejabberd_http_bind:process_http_put:608 Actually processing request: {http_put,876186,[{<<"xmlns">>,<<"http://jabber.org/protocol/httpbind">>},{<<"rid">>,<<"876186">>},{<<"sid">>,<<"a1e29cded4325f591bdc5b3646a8f3c78553cdd8">>},{<<"key">>,<<"9cffab80935471f419ce5c9201475df5935108d5">>}],[{xmlel,<<"iq">>,[{<<"xmlns">>,<<"jabber:client">>},{<<"to">>,<<"localhost">>},{<<"id">>,<<"4293567110">>},{<<"type">>,<<"result">>}],[{xmlel,<<"ping">>,[{<<"xmlns">>,<<"urn:xmpp:ping">>}],[]}]}],269,1,<<>>,{{0,0,0,0,0,65535,32512,1},58484}}
2015-01-09 18:25:31.234 [debug] <0.4052.0>@ejabberd_http_bind:process_http_put:619 Key/OldKey/NextKey: 9cffab80935471f419ce5c9201475df5935108d5/38516e6b293e317ee957f6ef74fa23c68a003d19/38516e6b293e317ee957f6ef74fa23c68a003d19
2015-01-09 18:25:31.234 [debug] <0.4052.0>@ejabberd_http_bind:process_http_put:659  -- SaveKey: 9cffab80935471f419ce5c9201475df5935108d5
2015-01-09 18:25:31.234 [debug] <0.4052.0>@ejabberd_http_bind:process_http_put:671 reqlist: [{hbr,876186,<<"38516e6b293e317ee957f6ef74fa23c68a003d19">>,[]},{hbr,876185,<<"38516e6b293e317ee957f6ef74fa23c68a003d19">>,[{xmlstreamelement,{xmlel,<<"iq">>,[{<<"from">>,<<"localhost">>},{<<"to">>,<<"agent1@localhost/cb_operator_1420818758533">>},{<<"id">>,<<"4293567110">>},{<<"type">>,<<"get">>}],[{xmlel,<<"ping">>,[{<<"xmlns">>,<<"urn:xmpp:ping">>}],[]}]}}]}]
2015-01-09 18:25:31.235 [debug] <0.4052.0>@ejabberd_http_bind:process_http_put:717 really sending now: [{xmlel,<<"iq">>,[{<<"xmlns">>,<<"jabber:client">>},{<<"to">>,<<"localhost">>},{<<"id">>,<<"4293567110">>},{<<"type">>,<<"result">>}],[{xmlel,<<"ping">>,[{<<"xmlns">>,<<"urn:xmpp:ping">>}],[]}]}]
2015-01-09 18:25:31.235 [debug] <0.4053.0>@ejabberd_router:do_route:322 route
    from {jid,<<"agent1">>,<<"localhost">>,<<"cb_operator_1420818758533">>,<<"agent1">>,<<"localhost">>,<<"cb_operator_1420818758533">>}
    to {jid,<<>>,<<"localhost">>,<<>>,<<>>,<<"localhost">>,<<>>}
    packet {xmlel,<<"iq">>,[{<<"to">>,<<"localhost">>},{<<"id">>,<<"4293567110">>},{<<"type">>,<<"result">>}],[{xmlel,<<"ping">>,[{<<"xmlns">>,<<"urn:xmpp:ping">>}],[]}]}
2015-01-09 18:25:31.235 [debug] <0.4053.0>@ejabberd_local:do_route:296 local route
    from {jid,<<"agent1">>,<<"localhost">>,<<"cb_operator_1420818758533">>,<<"agent1">>,<<"localhost">>,<<"cb_operator_1420818758533">>}
    to {jid,<<>>,<<"localhost">>,<<>>,<<>>,<<"localhost">>,<<>>}
    packet {xmlel,<<"iq">>,[{<<"to">>,<<"loca"...>>},{<<"id">>,<<...>>},{<<...>>,...}],[{xmlel,<<...>>,...}]}
2015-01-09 18:25:31.570 [info] <0.5318.0>@ejabberd_c2s:terminate:1757 ({socket_state,ejabberd_http_bind,{http_bind,<0.5317.0>,{{0,0,0,0,0,65535,32512,1},58451}},ejabberd_http_bind}) Close session for anonymous.c6502a950667fc79c3e1534559cc02e0@localhost/2b8e1ac2921d6d3713396edff70a0d2a
2015-01-09 18:25:31.571 [debug] <0.5318.0>@mod_pubsub:node_action:5143 node_action <<"pubsub.localhost">> <<"flat">> get_entity_affiliations [<<"pubsub.localhost">>,{<<"anonymous.c6502a950667fc79c3e1534559cc02e0">>,<<"localhost">>,<<"2b8e1ac2921d6d3713396edff70a0d2a">>}]
2015-01-09 18:25:31.571 [debug] <0.5318.0>@mod_pubsub:node_call:5124 node_call <<"flat">> get_entity_affiliations [<<"pubsub.localhost">>,{<<"anonymous.c6502a950667fc79c3e1534559cc02e0">>,<<"localhost">>,<<"2b8e1ac2921d6d3713396edff70a0d2a">>}]
2015-01-09 18:25:31.571 [debug] <0.5318.0>@mod_pubsub:node_action:5143 node_action <<"pubsub.localhost">> <<"hometree">> get_entity_affiliations [<<"pubsub.localhost">>,{<<"anonymous.c6502a950667fc79c3e1534559cc02e0">>,<<"localhost">>,<<"2b8e1ac2921d6d3713396edff70a0d2a">>}]
2015-01-09 18:25:31.572 [debug] <0.5318.0>@mod_pubsub:node_call:5124 node_call <<"hometree">> get_entity_affiliations [<<"pubsub.localhost">>,{<<"anonymous.c6502a950667fc79c3e1534559cc02e0">>,<<"localhost">>,<<"2b8e1ac2921d6d3713396edff70a0d2a">>}]
2015-01-09 18:25:31.572 [debug] <0.5318.0>@mod_pubsub:node_action:5143 node_action <<"pubsub.localhost">> <<"pep">> get_entity_affiliations [<<"pubsub.localhost">>,{<<"anonymous.c6502a950667fc79c3e1534559cc02e0">>,<<"localhost">>,<<"2b8e1ac2921d6d3713396edff70a0d2a">>}]
2015-01-09 18:25:31.572 [debug] <0.5318.0>@mod_pubsub:node_call:5124 node_call <<"pep">> get_entity_affiliations [<<"pubsub.localhost">>,{<<"anonymous.c6502a950667fc79c3e1534559cc02e0">>,<<"localhost">>,<<"2b8e1ac2921d6d3713396edff70a0d2a">>}]
2015-01-09 18:25:31.573 [debug] <0.5318.0>@mod_carboncopy:disable:246 disabling for <<"anonymous.c6502a950667fc79c3e1534559cc02e0">>
2015-01-09 18:25:31.574 [debug] <0.5318.0>@mod_shared_roster:unset_presence:1081 unset_presence for <<"anonymous.c6502a950667fc79c3e1534559cc02e0">> @ <<"localhost">> / <<"2b8e1ac2921d6d3713396edff70a0d2a">> -> <<>> (0 resources)
2015-01-09 18:25:31.574 [debug] <0.5318.0>@ejabberd_router:do_route:322 route

更多的日志在这里

我解决了自己的问题

我已经将mod_ping设置为终止会话,我相信BOSH连接管理器和mod_ping都在终止会话。我现在将mod_ping改为'timeout_action'改为'none',并让BOSH连接管理器处理断开检测

Inherit连接必须预先加载BOSH客户端通常从初始BOSH响应接收的参数。在我的例子中,依赖于遗留代码,“polling”参数在BOSH连接管理器以2响应时设置为5

JsJac在2秒的“请求”时间段内响应了多达5个新请求

所以我的逻辑是:mod_ping将每15秒发送一次ping,BOSH连接管理器将检查ping或任何其他节是否在4秒内响应

以下是来自Ejabberd BOSH连接管理器的初始响应:

<body xmlns="http://jabber.org/protocol/httpbind" xmlns:xmpp="urn:xmpp:xbosh" xmlns:stream="http://etherx.jabber.org/streams" sid="42e11a86ecba387ef5f53f5b86d38a8c7dc9ef5a" wait="300" requests="2" inactivity="480" maxpause="120" polling="2" ver="1.8" from="localhost" secure="true" authid="3627063868" xmpp:version="1.0"><stream:features xmlns:stream="http://etherx.jabber.org/streams"><bind xmlns="urn:ietf:params:xml:ns:xmpp-bind"/><session xmlns="urn:ietf:params:xml:ns:xmpp-session"/><sm xmlns="urn:xmpp:sm:2"/><sm xmlns="urn:xmpp:sm:3"/><c xmlns="http://jabber.org/protocol/caps" hash="sha-1" node="http://www.process-one.net/en/ejabberd/" ver="/nWL9StXSXhEsL2wg0+s4xo/UdA="/><register xmlns="http://jabber.org/features/iq-register"/></stream:features></body>
p、 在读取后,我将不活动设置为4秒,以便更快地检测断开连接

   args.polling = 2;
   args.inactivity = 4;
   args.requests = 2;
   args.wait = 300;

   self.connection.inherit(args);