[Jslib] socket.js usable for creating a whois client

Stephen Knight stknight at ultralifebatteries.com
Fri Jan 14 09:57:18 EST 2005

Sascha Strasser wrote:
> Hi there,
> i must program for a study-project a whois client. I want implement this 
> client in the mozilla framework.
> A IP Address will be send to whois.arin.net:43 and then choose if 
> necessary the next whois server.
> I have tried to use the socket.xul to connect the european whois server 
> ripe.net. I can connect them and after the connect i get the respose 
> from the server.
> [% This is the RIPE Whois query server #1.
> % The objects are in RPSL format.
> %
> % Rights restricted by copyright.
> % See http://www.ripe.net/db/copyright.html
> ]
> Length: 157
> But when i send the ip address like there will no response.
> I have tried to send some http Requests to my local webserver. The same 
> Problem after i have sent
> GET / HTTP/1.0
> there wasn't also a response from the server.
> Is there something special for sending strings?

Actually, the issue is more to do with how different servers respond.  HTTP servers (for example) 
immediately send their response and then close the socket.  When the socket gets closed the data is 
lost.  To be able to work with HTTP (and possibly whois), you need to open an async connection.  If 
you attempt to send-and-check-later, the connection will die and the response is lost.

Example code can be found here: http://bugzilla.mozdev.org/attachment.cgi?id=2437&action=view

Pete, I know I submitted a new socket.xul that demonstrated asynchronous socket usage with bug 
#8310, but it doesn't seem to be part of the release (as of 0.1.245) in samples.  Am I looking in 
the wrong spot?

hope this helps
Stephen Knight
Ultralife Batteries, Inc.

More information about the Jslib mailing list