Windows phone 7 无法在windows phone 7.5(vs2010)上使用strophe.js保持与XMPP服务器的连接

Windows phone 7 无法在windows phone 7.5(vs2010)上使用strophe.js保持与XMPP服务器的连接,windows-phone-7,cordova,openfire,strophe,Windows Phone 7,Cordova,Openfire,Strophe,我使用PhoneGap和strophe.js连接android 2.3中的openfire,它成功并保持连接 但我在WindowsPhone7中使用相同的代码,它先连接,然后才能收到消息。但它在几分钟或几秒钟内就会失败 连接->验证->连接->断开->连接失败->断开 连接和断开之间没有相同的时间 var username=XXX; var HOST_DOMAIN=XXX; var密码=XXX; var BOSH_服务=”http://127.0.0.1:7070/http-绑定/“; 连接=新

我使用PhoneGap和strophe.js连接android 2.3中的openfire,它成功并保持连接

但我在WindowsPhone7中使用相同的代码,它先连接,然后才能收到消息。但它在几分钟或几秒钟内就会失败

连接->验证->连接->断开->连接失败->断开

连接和断开之间没有相同的时间

var username=XXX;
var HOST_DOMAIN=XXX;
var密码=XXX;
var BOSH_服务=”http://127.0.0.1:7070/http-绑定/“;
连接=新的选通连接(BOSH_服务);
connection.connect(用户名+“@”+主机\域,密码,onConnect);
连接功能(状态){
如果(状态==Strophe.status.CONNECTED){
addHandler(notifyUser,null,“message”,null,null,null);
send($pres().tree());
}else if(状态==选通状态断开){
日志(“Strophe已断开连接”);
}
}
函数notifyUser(msg){
log(“msg:+Strophe.serialize(msg));
}
没有错误消息,只有strophe状态日志:

Log:["status=1","DebugConsole1005374909"]
Log:["Current Status is [CONNECTING]","DebugConsole1005374910"]
Log:["Strophe is connecting.","DebugConsole1005374911"]
Log:["status=3","DebugConsole1005374912"]
Log:["Current Status is [AUTHENTICATING]","DebugConsole1005374913"]
Log:["status=5","DebugConsole1005374914"]
Log:["Strophe is connected.","DebugConsole1005374916"]
Log:["Current Status is [CONNECTED]","DebugConsole1005374915"]

GapBrowser_Navigated :: /app/www/login.html#eventList

Log:["Strophe is disconnecting.","DebugConsole1005374922"]
Log:["status=2","DebugConsole1005374917"]
Log:["Current Status is [CONNFAIL]","DebugConsole1005374918"]
Log:["Strophe failed to connect.","DebugConsole1005374919"]。
Log:["status=7","DebugConsole1005374920"]
Log:["Current Status is [DISCONNECTING]","DebugConsole1005374921"]
Log:["Strophe is disconnected.","DebugConsole1005374925"]
Log:["status=6","DebugConsole1005374923"]
Log:["Current Status is [DISCONNECTED]","DebugConsole1005374924"]
Visual Studio 2010,
适用于Windows Phone 7.8的Windows Phone SDK更新

PhoneGap-2.9.0,
Windows Phone 7,
Openfire 3.7.1,
jquery.mobile-1.2.0.min.js,

strophejs-1.0.2

您应该能够看到来自BOSH连接器的POST响应中的错误:请复制并粘贴最后一个。我认为这可能与发现的问题有关-如果应用程序在后台运行,Windows 7/8不会保持套接字打开