|
View:
New views
2 Messages
—
Rating Filter:
Alert me
|
|
|
Sockets exampleI just discovered JSLib and I am very happy to find it! I am new to
JavaScript, and the prospect of figuring out XPCOM has not been inviting. I'm very surprised that I didn't find this sooner - nearly everywhere I looked for how to use sockets in JavaScript either said you could not do it, or you had to use XPCOM, or involved a sort of Flash bridge hack. I have a few questions. 1) I noticed that at http://jslib.mozdev.org/libraries/network/network.html the sockets.js file is not linked to documentation like the others. Is it unsupported or out of date/ 2) When I run the example socket.xul given at http://www.mozdev.org/mailarchives/jslib/2005-January/000486.html, I am never able to receive any data. If I for example, use www.google.com , port 80, and "GET / HTTP/1.1" (minus the quotes) as the parameters, I get... a status of "socket was opened...maybe" when I click open a status of "sent [GET / HTTP/1.1]" when I click send a status of "socket has 0 bytes waiting" when I test a status of "Received 0 bytes" when I receive I tried switching the SOCKET_XUL_ASYNC to false and this did not work either. What might I be doing wrong here? 3) Should I be able to set up TCP connections to a server written in VB.net, listening for connections? It seems like I should be able to do this, but after all the searching i've been doing (and failed attempts) it would be nice to hear someone tell me I was on the right track. Thanks, Nick _______________________________________________ Jslib mailing list Jslib@... http://mozdev.org/mailman/listinfo/jslib |
|
|
Re: Sockets exampleThe socket code is real old and I haven't tested it in a long while.
So essentially is is out of date and needs maintenance. --pete Nick P wrote: >I just discovered JSLib and I am very happy to find it! I am new to >JavaScript, and the prospect of figuring out XPCOM has not been >inviting. I'm very surprised that I didn't find this sooner - nearly >everywhere I looked for how to use sockets in JavaScript either said >you could not do it, or you had to use XPCOM, or involved a sort of >Flash bridge hack. > >I have a few questions. > >1) I noticed that at >http://jslib.mozdev.org/libraries/network/network.html the sockets.js >file is not linked to documentation like the others. Is it >unsupported or out of date/ > >2) When I run the example socket.xul given at >http://www.mozdev.org/mailarchives/jslib/2005-January/000486.html, I >am never able to receive any data. If I for example, use >www.google.com , port 80, and "GET / HTTP/1.1" (minus the quotes) as >the parameters, I get... >a status of "socket was opened...maybe" when I click open >a status of "sent [GET / HTTP/1.1]" when I click send >a status of "socket has 0 bytes waiting" when I test >a status of "Received 0 bytes" when I receive > >I tried switching the SOCKET_XUL_ASYNC to false and this did not work either. > >What might I be doing wrong here? > > >3) Should I be able to set up TCP connections to a server written in >VB.net, listening for connections? It seems like I should be able to >do this, but after all the searching i've been doing (and failed >attempts) it would be nice to hear someone tell me I was on the right >track. > >Thanks, >Nick >_______________________________________________ >Jslib mailing list >Jslib@... >http://mozdev.org/mailman/listinfo/jslib > > > > -- Pete Collins - Founder, Mozdev Group Inc. www.mozdevgroup.com Mozilla Software Development Solutions tel: 1-719-302-5811 fax: 1-719-302-5813 _______________________________________________ Jslib mailing list Jslib@... http://mozdev.org/mailman/listinfo/jslib |
| Free embeddable forum powered by Nabble | Forum Help |