[Jslib] Magic number in socket.js?

Stephen Knight stknight at ultralifebatteries.com
Wed Sep 10 17:36:30 EDT 2003


Pete Collins wrote:

> Stephen Knight wrote:
> 
>> Greetings,
>>   I'm currently flailing my way thru "socket.js" and I was wondering 
>> where the "magic number" "c07e81e0-ef12-11d2-92b6-00105a1b0d64" came 
>> from?
> 
> 
> That's the class ID.
> 
> It is a conanical unique identifier for an implementation class.
> 
> An example of a contractID wourld be:
> 
>    @mozilla.org/appshell/window-mediator;1
> 
> 
> These are all unique component class identifiers and all part of XPCOM.
> 
>   http://books.mozdev.org/html/mozilla-chp-8.html

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).

> 
> If you get it going again, remember, we will take your contributions.  :-)

No problem, once I get it clubbed into shape.



More information about the Jslib mailing list