[Jslib] Magic number in socket.js?

Charles Melhorn melodious at mindspring.com
Tue Sep 16 10:58:37 EDT 2003

Stephen Knight wrote:

> Ok.  That answers that question (I'll have to study that chapter to 
> see how one is supposed to find out a conanical).
>> Do note, the socket.js is very old, untouched for years and very 
>> broken..
> so I've noticed.  ;)  The last reference I've come across is Eric 
> Murphy talking about updating socket.js "in a couple of weeks"...two 
> years ago.
> I don't think I'm doing too badly.  I now have it:
> . opening a connection
> . writing data to the socket
> . reading some data (if binary then javascript nails any data after 
> the null, I have to study the javascript api to see if there's a 
> workaround)
> . reading text but it's always one message behind (some sort of 
> buffering/timing, I'm not using asynch routines yet).
> I'm mainly stumbling around trying to figure out the necessary 
> arguments to:
> openInputStream and openOutputStream.
> I'm not too sure if the transport is fully upto spec:
> . isAlive doesn't seem to work correctly (the target says the 
> connection is alive but isAlive denies it).
> I'm about to "study" Murphy's CBSConnection class (which means I'll 
> probably start stripping it for parts). 

You may find something useful in my version of socket.js, which
I cobbled together from the JsLib file and from the version used
in Chatzilla. It's not as polished, generalized, or commented as
it should be, and has only been tested with Mozilla 1.2 and 1.3;
however, I did consult with both Rob Ginda (Chatzilla author) and
Darin Fisher (primary necko developer) as I was developing it.


You can see how it's called (from the connectButtonHandler() routine)


Note that my socket class uses only asychronous routines, as the
synchronous calls weren't working with Moz 1.2/1.3.


More information about the Jslib mailing list