code does not work properly when i remove alert

sugar_lisp <[email protected]> Thu, 25 Feb 2010 15:57:41 -0800 (PST)
Newsgroups gmane.comp.mozilla.devel.jsdebugger
Message-ID <[email protected]>
Hi

I am facing a strange problem, in the code below when i remove alert
statement the client socket does not send data to the server. I have read
some forums on this problem and they mentioned about giving some time delay
but it does not work.

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 outstream = transport.openOutputStream(0,0,0);
alert('Sending Data'); //when i remove this statement the code does not work
properly

var len = y.length+'\n'+'';
outstream.write(len,len.length);
outstream.write(y,y.length); 
outstream.flush();

Please do let me know the solution to this problem.
-- 
View this message in context: http://old.nabble.com/code-does-not-work-properly-when-i-remove-alert-tp27695202p27695202.html
Sent from the Mozilla - JavaScript Debugger mailing list archive at Nabble.com.