Is there a way to disable the network manager?

1 view
Skip to first unread message

Daniel Hohenberger

unread,
Dec 9, 2009, 2:48:37 AM12/9/09
to mozilla-l...@googlegroups.com
I have a problem with my setup of Prism and local tomcat (accessed via
http://localhost:8083/my.app). Everything works fine untill I unplug my
network cable. Then I get an error message that the Server does not
respond when I try to load a page (or enter data in a field validated
via AJAX). When I plug it back in, everything works fine again. I can
only reproduce this problem in standalone Prism, not with Firefox or IE.

I got Prism to work when disconnected on startup by including the
following lines in my webapp.js, thanks to help on #prism:

> var ioService = Cc["@mozilla.org/network/io-service;1"].getService(Ci.nsIIOService);
> ioService.offline = false;

But when I disconnect while running, I get the problem described above.

Is there a way to permanently keep Prism online? I only use it for the
app running on localhost, so I don't really want it to react to any
network interfaces being unplugged...

Thanks in advance for any help,
Daniel

Matthew Gertner

unread,
Dec 15, 2009, 11:36:48 AM12/15/09
to mozilla-l...@googlegroups.com
You have to be a bit of an XPCOM hacker, but you can fix this by
writing a component that implements an observer for the
"network:offline-status-changed" topic. Then set the offline member of
the ioService to false as you did in your webapp.js if the status has
changed to "offline".

Matt
> --
>
> You received this message because you are subscribed to the Google Groups "mozilla-labs-prism" group.
> To post to this group, send email to mozilla-l...@googlegroups.com.
> To unsubscribe from this group, send email to mozilla-labs-pr...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/mozilla-labs-prism?hl=en.
>
>
>
Reply all
Reply to author
Forward
0 new messages