var transportService = Components.classes["@mozilla.org/network/socket-transport-service;1"].getService(Components.interfaces.nsISocketTransportService);
var transport = transportService.createTransport(null,0,'127.0.0.1',4444,null);
var stream = transport.openInputStream(0,0,0);
var instream = Components.classes["@mozilla.org/scriptableinputstream;1"]
var chunk = instream.read(512);
alert(chunk); // gives me blank, even though i send some string from the server
Please guide me and tell me what I am doing wrong.