Marek Lewczuk wrote:

Hello,
I have JS function which is checking connection with my server, but it is working in synchronous mode... How can I check server connection in async mode ?


Below my sync function:

var hostCheck = Components.classes["@mozilla.org/network/dns-service;1"].getService();
hostCheck.QueryInterface(Components.interfaces.nsIDNSService);
try {
var hostIP = hostCheck.resolve(SAMARAPP_DES_SERVER_HOST);
}
catch (ex) {
location.assign("Error_ServerUnreachable.xul");
}
_______________________________________________
Mozilla-xpcom mailing list
[EMAIL PROTECTED]
http://mail.mozilla.org/listinfo/mozilla-xpcom


it looks like you are using an older Mozilla (something less than 1.6). in that case, there is no way from JavaScript to issue an asynchronous DNS lookup. however, if you upgrade to Mozilla 1.6, then you can use the nsIDNSService::asyncResolve method.

-darin
_______________________________________________
Mozilla-xpcom mailing list
[EMAIL PROTECTED]
http://mail.mozilla.org/listinfo/mozilla-xpcom

Reply via email to