From nick.pend at gmail.com Thu Nov 8 21:57:51 2007 From: nick.pend at gmail.com (Nick P) Date: Fri, 9 Nov 2007 00:57:51 -0500 Subject: [Jslib] Sockets example Message-ID: 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 From pete at mozdevgroup.com Fri Nov 9 12:59:08 2007 From: pete at mozdevgroup.com (Pete Collins) Date: Fri, 09 Nov 2007 13:59:08 -0700 Subject: [Jslib] Sockets example In-Reply-To: References: Message-ID: <4734CA1C.9060704@mozdevgroup.com> The 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 at mozdev.org >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 From nick.pend at gmail.com Fri Nov 9 17:36:21 2007 From: nick.pend at gmail.com (Nick P) Date: Fri, 9 Nov 2007 20:36:21 -0500 Subject: [Jslib] Jslib] Sockets example Message-ID: Pete, Thank you for responding. I guess I will hold off on my celebration then until I see if it works. If there's a way I can help, any suggestions on where to get started to get this library working again? That might still be easier than my trying to figure out how to write the XPCOM from scratch, I guess. nick >The 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 On Nov 9, 2007 12:57 AM, 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 > From nick.pend at gmail.com Fri Nov 9 21:39:27 2007 From: nick.pend at gmail.com (Nick P) Date: Sat, 10 Nov 2007 00:39:27 -0500 Subject: [Jslib] Sockets example Message-ID: >From what I can tell, the sockets.xul sample opens the connection to the web server, but it somehow doesn't send the request properly. >From ethereal: 0000 00 0f b5 5e f1 8c 00 11 24 90 9f 26 08 00 45 00 ...^.... $..&..E. 0010 00 43 93 36 40 00 40 06 4f 13 c0 a8 01 07 d8 74 .C.6 at .@. O......t 0020 be 47 c7 1c 00 50 0f e0 af 94 e7 36 88 36 80 18 .G...P.. ...6.6.. 0030 ff ff 89 90 00 00 01 01 08 0a 91 b5 4b 2c 1f 2b ........ ....K,.+ 0040 22 7d 48 54 54 50 20 2f 20 47 45 54 2f 31 2e 31 "}HTTP / GET/1.1 0050 00 Rather that noting the HTTP / GET/1.1 as a request, it is labeled as "Continuation or non-HTTP traffic" by ethereal. It gets an ack back from the server. Here's an example of a legitimate get request: 0000 00 0f b5 5e f1 8c 00 11 24 90 9f 26 08 00 45 00 ...^.... $..&..E. 0010 01 d0 93 81 40 00 40 06 fb fa c0 a8 01 07 40 e9 .... at .@. ...... at . 0020 a7 13 c7 24 00 50 66 86 aa 48 fe f7 a7 e0 80 18 ...$.Pf. .H...... 0030 ff ff d8 21 00 00 01 01 08 0a 91 b5 4c 08 16 5c ...!.... ....L..\ 0040 3e 98 47 45 54 20 2f 20 48 54 54 50 2f 31 2e 31 >.GET / HTTP/1.1 0050 0d 0a 48 6f 73 74 3a 20 77 77 77 2e 67 6d 61 69 ..Host: www.gmai 0060 6c 2e 63 6f 6d 0d 0a 55 73 65 72 2d 41 67 65 6e l.com..U ser-Agen 0070 74 3a 20 4d 6f 7a 69 6c 6c 61 2f 35 2e 30 20 28 t: Mozil la/5.0 ( 0080 4d 61 63 69 6e 74 6f 73 68 3b 20 55 3b 20 50 50 Macintos h; U; PP 0090 43 20 4d 61 63 20 4f 53 20 58 20 4d 61 63 68 2d C Mac OS X Mach- 00a0 4f 3b 20 65 6e 2d 55 53 3b 20 72 76 3a 31 2e 38 O; en-US ; rv:1.8 00b0 2e 31 2e 39 29 20 47 65 63 6b 6f 2f 32 30 30 37 .1.9) Ge cko/2007 00c0 31 30 32 35 20 46 69 72 65 66 6f 78 2f 32 2e 30 1025 Fir efox/2.0 00d0 2e 30 2e 39 0d 0a 41 63 63 65 70 74 3a 20 74 65 .0.9..Ac cept: te 00e0 78 74 2f 78 6d 6c 2c 61 70 70 6c 69 63 61 74 69 xt/xml,a pplicati 00f0 6f 6e 2f 78 6d 6c 2c 61 70 70 6c 69 63 61 74 69 on/xml,a pplicati 0100 6f 6e 2f 78 68 74 6d 6c 2b 78 6d 6c 2c 74 65 78 on/xhtml +xml,tex 0110 74 2f 68 74 6d 6c 3b 71 3d 30 2e 39 2c 74 65 78 t/html;q =0.9,tex 0120 74 2f 70 6c 61 69 6e 3b 71 3d 30 2e 38 2c 69 6d t/plain; q=0.8,im 0130 61 67 65 2f 70 6e 67 2c 2a 2f 2a 3b 71 3d 30 2e age/png, */*;q=0. 0140 35 0d 0a 41 63 63 65 70 74 2d 4c 61 6e 67 75 61 5..Accep t-Langua 0150 67 65 3a 20 65 6e 2d 75 73 2c 65 6e 3b 71 3d 30 ge: en-u s,en;q=0 0160 2e 35 0d 0a 41 63 63 65 70 74 2d 45 6e 63 6f 64 .5..Acce pt-Encod 0170 69 6e 67 3a 20 67 7a 69 70 2c 64 65 66 6c 61 74 ing: gzi p,deflat 0180 65 0d 0a 41 63 63 65 70 74 2d 43 68 61 72 73 65 e..Accep t-Charse 0190 74 3a 20 49 53 4f 2d 38 38 35 39 2d 31 2c 75 74 t: ISO-8 859-1,ut 01a0 66 2d 38 3b 71 3d 30 2e 37 2c 2a 3b 71 3d 30 2e f-8;q=0. 7,*;q=0. 01b0 37 0d 0a 4b 65 65 70 2d 41 6c 69 76 65 3a 20 33 7..Keep- Alive: 3 01c0 30 30 0d 0a 43 6f 6e 6e 65 63 74 69 6f 6e 3a 20 00..Conn ection: 01d0 6b 65 65 70 2d 61 6c 69 76 65 0d 0a 0d 0a keep-ali ve.... Don't know if that helps any. Sorry of this is out of thread. I just subscribed. From pete at mozdevgroup.com Mon Nov 12 05:37:15 2007 From: pete at mozdevgroup.com (Pete Collins) Date: Mon, 12 Nov 2007 06:37:15 -0700 Subject: [Jslib] Sockets example In-Reply-To: References: Message-ID: <4738570B.4050205@mozdevgroup.com> Ok, yea I can confirm that the socket is sending but that's it ... I am not seeing any errors in the console either. So since this code is fairly old I will surmise that there has been an underlying API change breaking the socket code. I could be as simple as a component function rename, component class id change, interface rename, etc ... I will try to take a look. --pete Nick P wrote: >>From what I can tell, the sockets.xul sample opens the connection to >the web server, but it somehow doesn't send the request properly. > >>From ethereal: >0000 00 0f b5 5e f1 8c 00 11 24 90 9f 26 08 00 45 00 ...^.... $..&..E. >0010 00 43 93 36 40 00 40 06 4f 13 c0 a8 01 07 d8 74 .C.6 at .@. O......t >0020 be 47 c7 1c 00 50 0f e0 af 94 e7 36 88 36 80 18 .G...P.. ...6.6.. >0030 ff ff 89 90 00 00 01 01 08 0a 91 b5 4b 2c 1f 2b ........ ....K,.+ >0040 22 7d 48 54 54 50 20 2f 20 47 45 54 2f 31 2e 31 "}HTTP / GET/1.1 >0050 00 > >Rather that noting the HTTP / GET/1.1 as a request, it is labeled as >"Continuation or non-HTTP traffic" by ethereal. It gets an ack back >from the server. > >Here's an example of a legitimate get request: > >0000 00 0f b5 5e f1 8c 00 11 24 90 9f 26 08 00 45 00 ...^.... $..&..E. >0010 01 d0 93 81 40 00 40 06 fb fa c0 a8 01 07 40 e9 .... at .@. ...... at . >0020 a7 13 c7 24 00 50 66 86 aa 48 fe f7 a7 e0 80 18 ...$.Pf. .H...... >0030 ff ff d8 21 00 00 01 01 08 0a 91 b5 4c 08 16 5c ...!.... ....L..\ >0040 3e 98 47 45 54 20 2f 20 48 54 54 50 2f 31 2e 31 >.GET / HTTP/1.1 >0050 0d 0a 48 6f 73 74 3a 20 77 77 77 2e 67 6d 61 69 ..Host: www.gmai >0060 6c 2e 63 6f 6d 0d 0a 55 73 65 72 2d 41 67 65 6e l.com..U ser-Agen >0070 74 3a 20 4d 6f 7a 69 6c 6c 61 2f 35 2e 30 20 28 t: Mozil la/5.0 ( >0080 4d 61 63 69 6e 74 6f 73 68 3b 20 55 3b 20 50 50 Macintos h; U; PP >0090 43 20 4d 61 63 20 4f 53 20 58 20 4d 61 63 68 2d C Mac OS X Mach- >00a0 4f 3b 20 65 6e 2d 55 53 3b 20 72 76 3a 31 2e 38 O; en-US ; rv:1.8 >00b0 2e 31 2e 39 29 20 47 65 63 6b 6f 2f 32 30 30 37 .1.9) Ge cko/2007 >00c0 31 30 32 35 20 46 69 72 65 66 6f 78 2f 32 2e 30 1025 Fir efox/2.0 >00d0 2e 30 2e 39 0d 0a 41 63 63 65 70 74 3a 20 74 65 .0.9..Ac cept: te >00e0 78 74 2f 78 6d 6c 2c 61 70 70 6c 69 63 61 74 69 xt/xml,a pplicati >00f0 6f 6e 2f 78 6d 6c 2c 61 70 70 6c 69 63 61 74 69 on/xml,a pplicati >0100 6f 6e 2f 78 68 74 6d 6c 2b 78 6d 6c 2c 74 65 78 on/xhtml +xml,tex >0110 74 2f 68 74 6d 6c 3b 71 3d 30 2e 39 2c 74 65 78 t/html;q =0.9,tex >0120 74 2f 70 6c 61 69 6e 3b 71 3d 30 2e 38 2c 69 6d t/plain; q=0.8,im >0130 61 67 65 2f 70 6e 67 2c 2a 2f 2a 3b 71 3d 30 2e age/png, */*;q=0. >0140 35 0d 0a 41 63 63 65 70 74 2d 4c 61 6e 67 75 61 5..Accep t-Langua >0150 67 65 3a 20 65 6e 2d 75 73 2c 65 6e 3b 71 3d 30 ge: en-u s,en;q=0 >0160 2e 35 0d 0a 41 63 63 65 70 74 2d 45 6e 63 6f 64 .5..Acce pt-Encod >0170 69 6e 67 3a 20 67 7a 69 70 2c 64 65 66 6c 61 74 ing: gzi p,deflat >0180 65 0d 0a 41 63 63 65 70 74 2d 43 68 61 72 73 65 e..Accep t-Charse >0190 74 3a 20 49 53 4f 2d 38 38 35 39 2d 31 2c 75 74 t: ISO-8 859-1,ut >01a0 66 2d 38 3b 71 3d 30 2e 37 2c 2a 3b 71 3d 30 2e f-8;q=0. 7,*;q=0. >01b0 37 0d 0a 4b 65 65 70 2d 41 6c 69 76 65 3a 20 33 7..Keep- Alive: 3 >01c0 30 30 0d 0a 43 6f 6e 6e 65 63 74 69 6f 6e 3a 20 00..Conn ection: >01d0 6b 65 65 70 2d 61 6c 69 76 65 0d 0a 0d 0a keep-ali ve.... > >Don't know if that helps any. > >Sorry of this is out of thread. I just subscribed. >_______________________________________________ >Jslib mailing list >Jslib at mozdev.org >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 From nick.pend at gmail.com Tue Nov 13 20:50:51 2007 From: nick.pend at gmail.com (Nick P) Date: Tue, 13 Nov 2007 23:50:51 -0500 Subject: [Jslib] Sockets example In-Reply-To: <4738570B.4050205@mozdevgroup.com> References: <4738570B.4050205@mozdevgroup.com> Message-ID: Pete, Although I could not get the client to connect to a web server properly, when I made a small server application in VB.net, it was able to connect, send, and receive. I believe the only failure was that after my server closed the connection, socket.xul did not recognize the connection as closed. It was closed using TcpClient's Close() member in System.Net.Sockets in VB.net. There's an update for you. Maybe the something is munging up the HTTP GET or the string in some way. the server stub I am using is not looking for any particular protocol; it's responding to anything. I'll still look for updates if you find something. Thanks, nick On Nov 12, 2007 8:37 AM, Pete Collins wrote: > Ok, yea I can confirm that the socket is sending but that's it ... > > I am not seeing any errors in the console either. > > So since this code is fairly old I will surmise that there has been an > underlying API change breaking the socket code. > > I could be as simple as a component function rename, component class id > change, interface rename, etc ... > > I will try to take a look. > > --pete > > > > > Nick P wrote: > > >>From what I can tell, the sockets.xul sample opens the connection to > >the web server, but it somehow doesn't send the request properly. > > > >>From ethereal: > >0000 00 0f b5 5e f1 8c 00 11 24 90 9f 26 08 00 45 00 ...^.... $..&..E. > >0010 00 43 93 36 40 00 40 06 4f 13 c0 a8 01 07 d8 74 .C.6 at .@. O......t > >0020 be 47 c7 1c 00 50 0f e0 af 94 e7 36 88 36 80 18 .G...P.. ...6.6.. > >0030 ff ff 89 90 00 00 01 01 08 0a 91 b5 4b 2c 1f 2b ........ ....K,.+ > >0040 22 7d 48 54 54 50 20 2f 20 47 45 54 2f 31 2e 31 "}HTTP / GET/1.1 > >0050 00 > > > >Rather that noting the HTTP / GET/1.1 as a request, it is labeled as > >"Continuation or non-HTTP traffic" by ethereal. It gets an ack back > >from the server. > > > >Here's an example of a legitimate get request: > > > >0000 00 0f b5 5e f1 8c 00 11 24 90 9f 26 08 00 45 00 ...^.... $..&..E. > >0010 01 d0 93 81 40 00 40 06 fb fa c0 a8 01 07 40 e9 .... at .@. ...... at . > >0020 a7 13 c7 24 00 50 66 86 aa 48 fe f7 a7 e0 80 18 ...$.Pf. .H...... > >0030 ff ff d8 21 00 00 01 01 08 0a 91 b5 4c 08 16 5c ...!.... ....L..\ > >0040 3e 98 47 45 54 20 2f 20 48 54 54 50 2f 31 2e 31 >.GET / HTTP/1.1 > >0050 0d 0a 48 6f 73 74 3a 20 77 77 77 2e 67 6d 61 69 ..Host: www.gmai > >0060 6c 2e 63 6f 6d 0d 0a 55 73 65 72 2d 41 67 65 6e l.com..U ser-Agen > >0070 74 3a 20 4d 6f 7a 69 6c 6c 61 2f 35 2e 30 20 28 t: Mozil la/5.0 ( > >0080 4d 61 63 69 6e 74 6f 73 68 3b 20 55 3b 20 50 50 Macintos h; U; PP > >0090 43 20 4d 61 63 20 4f 53 20 58 20 4d 61 63 68 2d C Mac OS X Mach- > >00a0 4f 3b 20 65 6e 2d 55 53 3b 20 72 76 3a 31 2e 38 O; en-US ; rv:1.8 > >00b0 2e 31 2e 39 29 20 47 65 63 6b 6f 2f 32 30 30 37 .1.9) Ge cko/2007 > >00c0 31 30 32 35 20 46 69 72 65 66 6f 78 2f 32 2e 30 1025 Fir efox/2.0 > >00d0 2e 30 2e 39 0d 0a 41 63 63 65 70 74 3a 20 74 65 .0.9..Ac cept: te > >00e0 78 74 2f 78 6d 6c 2c 61 70 70 6c 69 63 61 74 69 xt/xml,a pplicati > >00f0 6f 6e 2f 78 6d 6c 2c 61 70 70 6c 69 63 61 74 69 on/xml,a pplicati > >0100 6f 6e 2f 78 68 74 6d 6c 2b 78 6d 6c 2c 74 65 78 on/xhtml +xml,tex > >0110 74 2f 68 74 6d 6c 3b 71 3d 30 2e 39 2c 74 65 78 t/html;q =0.9,tex > >0120 74 2f 70 6c 61 69 6e 3b 71 3d 30 2e 38 2c 69 6d t/plain; q=0.8,im > >0130 61 67 65 2f 70 6e 67 2c 2a 2f 2a 3b 71 3d 30 2e age/png, */*;q=0. > >0140 35 0d 0a 41 63 63 65 70 74 2d 4c 61 6e 67 75 61 5..Accep t-Langua > >0150 67 65 3a 20 65 6e 2d 75 73 2c 65 6e 3b 71 3d 30 ge: en-u s,en;q=0 > >0160 2e 35 0d 0a 41 63 63 65 70 74 2d 45 6e 63 6f 64 .5..Acce pt-Encod > >0170 69 6e 67 3a 20 67 7a 69 70 2c 64 65 66 6c 61 74 ing: gzi p,deflat > >0180 65 0d 0a 41 63 63 65 70 74 2d 43 68 61 72 73 65 e..Accep t-Charse > >0190 74 3a 20 49 53 4f 2d 38 38 35 39 2d 31 2c 75 74 t: ISO-8 859-1,ut > >01a0 66 2d 38 3b 71 3d 30 2e 37 2c 2a 3b 71 3d 30 2e f-8;q=0. 7,*;q=0. > >01b0 37 0d 0a 4b 65 65 70 2d 41 6c 69 76 65 3a 20 33 7..Keep- Alive: 3 > >01c0 30 30 0d 0a 43 6f 6e 6e 65 63 74 69 6f 6e 3a 20 00..Conn ection: > >01d0 6b 65 65 70 2d 61 6c 69 76 65 0d 0a 0d 0a keep-ali ve.... > > > >Don't know if that helps any. > > > >Sorry of this is out of thread. I just subscribed. > >_______________________________________________ > >Jslib mailing list > >Jslib at mozdev.org > >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 at mozdev.org > http://mozdev.org/mailman/listinfo/jslib > From rajeev.sebastian at gmail.com Wed Nov 14 15:00:42 2007 From: rajeev.sebastian at gmail.com (Rajeev J Sebastian) Date: Thu, 15 Nov 2007 04:30:42 +0530 Subject: [Jslib] Sockets example In-Reply-To: References: <4738570B.4050205@mozdevgroup.com> Message-ID: <79a035420711141500l7e115b53v94809a33383708be@mail.gmail.com> Hello Nick, Are you trying to access an HTTP server with this ? Regards Rajeev J Sebastian From nick.pend at gmail.com Mon Nov 19 09:14:38 2007 From: nick.pend at gmail.com (Nick P) Date: Mon, 19 Nov 2007 12:14:38 -0500 Subject: [Jslib] Sockets example In-Reply-To: <79a035420711141500l7e115b53v94809a33383708be@mail.gmail.com> References: <4738570B.4050205@mozdevgroup.com> <79a035420711141500l7e115b53v94809a33383708be@mail.gmail.com> Message-ID: Rajeev, My goal it to connect via TCP to a server that I will design. I was using web servers just to test it to see if it would work, by opening a connection and sending and HTTP GET command. As I noted, however, this did not work - but I have seen some success with a simple tcp socket connection (with no specific command required, it just receives anything). nick On Nov 14, 2007 6:00 PM, Rajeev J Sebastian wrote: > Hello Nick, > > Are you trying to access an HTTP server with this ? > > Regards > Rajeev J Sebastian > _______________________________________________ > Jslib mailing list > Jslib at mozdev.org > https://www.mozdev.org/mailman/listinfo/jslib > From rajeev.sebastian at gmail.com Sat Nov 24 10:57:33 2007 From: rajeev.sebastian at gmail.com (Rajeev J Sebastian) Date: Sun, 25 Nov 2007 00:27:33 +0530 Subject: [Jslib] Sockets example In-Reply-To: References: <4738570B.4050205@mozdevgroup.com> <79a035420711141500l7e115b53v94809a33383708be@mail.gmail.com> Message-ID: <79a035420711241057i6a488e8eu339888f33128e1a0@mail.gmail.com> Great! Good luck to you. Regards Rajeev J Sebastian On Nov 19, 2007 10:44 PM, Nick P wrote: > Rajeev, > > My goal it to connect via TCP to a server that I will design. I was > using web servers just to test it to see if it would work, by opening > a connection and sending and HTTP GET command. As I noted, however, > this did not work - but I have seen some success with a simple tcp > socket connection (with no specific command required, it just receives > anything). > > nick > > > On Nov 14, 2007 6:00 PM, Rajeev J Sebastian wrote: > > Hello Nick, > > > > Are you trying to access an HTTP server with this ? > > > > Regards > > Rajeev J Sebastian > > > _______________________________________________ > > Jslib mailing list > > Jslib at mozdev.org > > https://www.mozdev.org/mailman/listinfo/jslib > > > _______________________________________________ > Jslib mailing list > Jslib at mozdev.org > https://www.mozdev.org/mailman/listinfo/jslib > From nick.pend at gmail.com Fri Nov 30 15:03:24 2007 From: nick.pend at gmail.com (Nick P) Date: Fri, 30 Nov 2007 18:03:24 -0500 Subject: [Jslib] Reading available data on recently closed sockets Message-ID: I am still attempting to use JSLib as a client for a server. After the server sends a reply message, it closes the socket. Up until the socket is closed by the server, the XUL client recognizes that there is data available. When I built a sample client in VB.net, I was able to read the available data even after the server closed the socket. However, with the JSLib sockets, I have been unable to get it to read the data after the server closes the socket. I modified the socket.xul example to with a function that tests to check three functions for the socket: isAlive, isConnected, and isOpen -- After I close the server socket, and then call Available, all of three functions returned true, but available() returns zero. If I call the function once more, IsAlive and IsOpen are true, but isConnected is false. Am I wrong that this data should still be available for reading, or is this unexpected behavior? Any suggestions? Thanks, Nick -------------- next part -------------- An HTML attachment was scrubbed... URL: http://www.mozdev.org/pipermail/jslib/attachments/20071130/1d8142c6/attachment.html