views:

95

answers:

3

Hey, I'm trying to get an extension to wait for a xml message from another program over an internal port. Just something like waiting for a single UTF-8 string that has something like:

<?xml version="1.0"?>
<status received="true" state="started"></status>

and

<?xml version="1.0"?>
<status received="true" conn="closed"></status>

I want to reliably report communication between the two, along with some nice little error messages.

The program that I'm sending xml messages to is a completely standalone Java application that runs on the user's machine, the extension is allowing the user to open files using that application through the browser. The application sends several xml messages out on the port its using(and thus the port the extension is using) when it receives incoming connections and sends out xml status updates.

A: 

If you're doing anything with firefox and javascript, consider getting Firebug. It has network listening as well as all kinds of things you'll love!

getfirebug.com

glowcoder
This is not an answer.
SLaks
Yeah, I have firebug, but it isn't going to make my extension listen over a port.
Nathan
+2  A: 

I just found nsIServerSocket and I think this is what I want. I'm going to try it out and report back, but if anyone knows of a more appropriate Mozilla service to use please tell!

Nathan
Yeah, that worked.
Nathan
+1  A: 

Why not make use of websockets or ajax calls, particularly if it a webserver behind the internal port you are trying to connect / listen ?

phoenix24
I'm editing my post for more clarity.
Nathan