Hey
guys, I'm using an nsiServerSocket from a Firefox Addon, and I've
noticed that it has problems with suspend/resume on OSX and
occasionally Windows, but not Linux.
On platforms like OSX,
after a suspend/resume the ServerSocket is often just gone, but the
onStopListening callback is never called. So there's no way to know
this.
As a workaround, I've been trying to close the
nsiSeverSocket when I get a sleep_notification event, and then
re-create it when I get a wake_notification event. Closing it on
sleep_notification seems to go fine, but when I try to create it again
on wake_notification I get:
Error: [Exception... "Component returned failure code: 0xc1f30001
(NS_ERROR_NOT_INITIALIZED) [nsIServerSocket.asyncListen]" nsresult:
"0xc1f30001 (NS_ERROR_NOT_INITIALIZED)" location: "JS frame ::
The
function that I'm calling to create it looks like this:
LocalProxy.prototype.constructServerSocket = function() {
this.serverSocket =
Components.classes["@mozilla.org/network/server-socket;1"].createInstance(Components.interfaces.nsIServerSocket);
this.serverSocket.init(-1,true,-1);
this.serverSocket.asyncListen(this);
};
...so
I am calling init, and it works fine when I'm not doing it from a
wake_notification handler. Any insight into what's amiss here?
Thanks,
- Clement
_______________________________________________
dev-tech-network mailing list
[email protected]
https://lists.mozilla.org/listinfo/dev-tech-network