Sockets project
I am investigating the options available for peer-to-peer messaging and direct data transfer for The Scripter's Scrapbook. If anyone has experience in sockets and would like to be involved, please contact me off-line at [EMAIL PROTECTED] Hugh Senior The Flexible Learning Company The Scripter's Scrapbook: www.ssbk.co.uk ___ metacard mailing list [EMAIL PROTECTED] http://lists.runrev.com/mailman/listinfo/metacard
Re: Sockets project
On Nov 19, 2004, at 2:46 AM, [EMAIL PROTECTED] wrote: I am investigating the options available for peer-to-peer messaging and direct data transfer for The Scripter's Scrapbook. If anyone has experience in sockets and would like to be involved, please contact me off-line at [EMAIL PROTECTED] Hi Hugh, While I have a super full plate at the moment, I offer my simple chat program that runs peer to peer. It is well commented and can be found on revNet. It is under CS Chatter Box. Hope it can help some. -- Best regards, Mark Talluto http://www.canelasoftware.com ___ metacard mailing list [EMAIL PROTECTED] http://lists.runrev.com/mailman/listinfo/metacard
Sockets and Servers with Linux 2.4.3
Haven't tracked this down yet... but in moving a simple http server stack over to run under the Linux 2.4.3 engine - I get no connection. The same stack serves up files fine with the 2.4.2 MacOs PPC version. I note there have been some changes to the way datagram sockets work in 2.4.3: The operation of datagram sockets has been changed on all platforms. In previous releases it was not possible to read and write to the same datagram socket. Now, you can do a single read from socket s with message m on the client datagram socket after opening it and all packets that arrive on that socket will send message m. On the datagram server side, when a new packet arrives, a new socket that has the client address will be opened. You can then write to this socket to send a message back to the client, or immediately close it if only new incoming packets are needed. Could this change the way the HTTP server works - based on Andu's original ___ metacard mailing list [EMAIL PROTECTED] http://lists.runrev.com/mailman/listinfo/metacard
MetaCard 243 B2 sockets on MacOS
MetaCard 2.4.3 alpha 2 is now available in the directory ft p://ftp.metacard.com/MetaCard/2.4.3/ See the README file in that directory for more information. Scott Sorry Scott, but opening TCP sockets on MacOS PPC (OS 8.6) is still broken...or have you severely changed something? I can use my method of connecting perfectly up to this last 2.4.3 version. JR ___ metacard mailing list [EMAIL PROTECTED] http://lists.runrev.com/mailman/listinfo/metacard
Re: Sockets
There is a sockets example on the Runtime website, have a look at the user contributions section on the page below. http://www.runrev.com/revolution/developers/index.html Cheers, Rod Rod McCall Runtime Revolution Ltd, Edinburgh UK www.runrev.com - Original Message - From: Phil Davis [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Tuesday, September 18, 2001 5:21 AM Subject: Re: Sockets Hi Greg, There's a lot of info out there about sockets. Some of it can even be understood by non-network-engineer types! No MetaTalk examples, but you'll get it anyway. Here's a nice definition: http://www.freesoft.org/CIE/Topics/20.htm You may gain more insight by comparing that one to some others: http://whatis.techtarget.com/definition/0,,sid9_gci213021,00.html http://www.webopedia.com/TERM/s/socket.html For additional 'net info, I personally think the freesoft.org Programmed Instruction Course is a great intro to how the internet works: http://www.freesoft.org/CIE/Course/index.htm Hope this helps. Phil - Original Message - From: Gregory Lypny [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Monday, September 17, 2001 5:03 PM Subject: Sockets Hi Everyone, Where can I find a primer on sockets, something like Sockets for Dummies with lots of MetaCard examples. Regards, Greg Gregory Lypny Associate Professor John Molson School of Business Concordia University _ Absence of evidence is not evidence of absence. - Anonymous Archives: http://www.mail-archive.com/metacard@lists.runrev.com/ Info: http://www.xworlds.com/metacard/mailinglist.htm Please send bug reports to [EMAIL PROTECTED], not this list. Archives: http://www.mail-archive.com/metacard@lists.runrev.com/ Info: http://www.xworlds.com/metacard/mailinglist.htm Please send bug reports to [EMAIL PROTECTED], not this list.
Re: Sockets
Thanks for the socket references. I've got some homework to do. Greg Archives: http://www.mail-archive.com/metacard@lists.runrev.com/ Info: http://www.xworlds.com/metacard/mailinglist.htm Please send bug reports to [EMAIL PROTECTED], not this list.
Sockets
Hi Everyone, Where can I find a primer on sockets, something like "Sockets for Dummies" with lots of MetaCard examples. Regards, Greg Gregory Lypny Associate Professor John Molson School of Business Concordia University _ "Absence of evidence is not evidence of absence." - Anonymous
Re: Sockets
Hi Greg, There's a lot of info out there about sockets. Some of it can even be understood by non-network-engineer types! No MetaTalk examples, but you'll get it anyway. Here's a nice definition: http://www.freesoft.org/CIE/Topics/20.htm You may gain more insight by comparing that one to some others: http://whatis.techtarget.com/definition/0,,sid9_gci213021,00.html http://www.webopedia.com/TERM/s/socket.html For additional 'net info, I personally think the freesoft.org Programmed Instruction Course is a great intro to how the internet works: http://www.freesoft.org/CIE/Course/index.htm Hope this helps. Phil - Original Message - From: Gregory Lypny [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Monday, September 17, 2001 5:03 PM Subject: Sockets Hi Everyone, Where can I find a primer on sockets, something like Sockets for Dummies with lots of MetaCard examples. Regards, Greg Gregory Lypny Associate Professor John Molson School of Business Concordia University _ Absence of evidence is not evidence of absence. - Anonymous Archives: http://www.mail-archive.com/metacard@lists.runrev.com/ Info: http://www.xworlds.com/metacard/mailinglist.htm Please send bug reports to [EMAIL PROTECTED], not this list.
Re: sockets
From: Rodney Tamblyn [EMAIL PROTECTED] Subject: sockets Date: Mon, 27 Aug 2001 17:08:59 +1200 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii I have been having fun working with sockets in Metacard, and in general everything seems to work fine. Some socket questions: When using sockets to read and write I have been using the following approach: write the length of the packet on a line followed by the data, at receiving end read for one line, then read for the supplied number of characters. What approaches do others use? You can also read without specifying a for condition, a specified handler will be called when data arrives. Are there any advantages/disadvantages of one approach over the other? read from socket s with message newData is probably the best way...it threads the socket reading, so your program doesn't come to a halt. You just need to handle the newData message (or whatever you want to call it) which has the data and the socket. You should wrap your communications in something (i use reply/reply so you know when you have all of your data (i.e. if its a bunch of data, you might get a couple of messages with only part of the info). As far as leaving them open, I tried leaving them open for short bursts...something like Computer 1 Computer 2 Request Process Request Send OK or more data if OK, close socket if data, process and send back ok or data and continue until one says OK. Unless you are doing something high-speed like online gaming, I think that its smarter to close sockets...but I could be wrong at that.. Hope this helps! -ml In general, if you have two stacks that are going to have an ongoing series of communications going backwards and forwards, is it better to leave the socket open, or always close the socket after each communication. I've assumed the latter. Presumably there is a limit on the number of sockets MC can have open? When MC has an open socket, does it periodically attempt to verify whether the remote party is still present? Any other comments or tips from people who are experienced using sockets in Metacard would be appreciated. Rodney -- -- Rodney Tamblyn Educational Media group Higher Education Development Centre, 75 Union Place University of Otago, PO Box 56, Dunedin, New Zealand ph +64 3 479 7580 Fax +64 3 479 8362 http://hedc.otago.ac.nz ~ http://rodney.weblogs.com -- Mark J. Luetzelschwab [EMAIL PROTECTED] Graduate Research Assistant (v) (512) 232 6034 Instructional Technology(f) (512) 232 2322 Reading and Language Arts: http://www.texasreading.org Archives: http://www.mail-archive.com/metacard@lists.runrev.com/ Info: http://www.xworlds.com/metacard/mailinglist.htm Please send bug reports to [EMAIL PROTECTED], not this list.
Re: sockets
- Original Message - From: Rodney Tamblyn [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Sunday, August 26, 2001 10:08 PM Subject: sockets I have been having fun working with sockets in Metacard, and in general everything seems to work fine. Some socket questions: When using sockets to read and write I have been using the following approach: write the length of the packet on a line followed by the data, at receiving end read for one line, then read for the supplied number of characters. What approaches do others use? You can also read without specifying a for condition, a specified handler will be called when data arrives. Are there any advantages/disadvantages of one approach over the other? In general, if you have two stacks that are going to have an ongoing series of communications going backwards and forwards, is it better to leave the socket open, or always close the socket after each communication. I've assumed the latter. Have you tried using datagram (UDP or connectionless) sockets? This causes the sent data to arrive as a parameter variable of the arrival message rather than as a data stream to be read. For example (in event sequence order): -- in the receiving stack (at IP address 11.33.55.77) -- accept datagram connections on port 5 \ with message newConnection -- in the sending stack (at IP address 22.44.66.88) -- put 11.33.55.77:5 into tDestination open datagram socket to tDestination write (data data data data) to tDestination close socket tDestination -- back in the receiving stack -- on newConnection pSenderAddress, pSentData answer hostNameToAddress(hostName()) says: cr \ pSenderAddress sent the following: cr \ pSentData end newConnection If I got it right, the above code would display this message: 11.33.55.77 says: 22.44.66.88 sent the following: data data data data Food for thought. (I'm not sure if the newConnection UDP socket closes automatically or if it has to be closed with a close command.) Phil Presumably there is a limit on the number of sockets MC can have open? When MC has an open socket, does it periodically attempt to verify whether the remote party is still present? Any other comments or tips from people who are experienced using sockets in Metacard would be appreciated. Rodney -- -- Rodney Tamblyn Educational Media group Higher Education Development Centre, 75 Union Place University of Otago, PO Box 56, Dunedin, New Zealand ph +64 3 479 7580 Fax +64 3 479 8362 http://hedc.otago.ac.nz ~ http://rodney.weblogs.com Archives: http://www.mail-archive.com/metacard@lists.runrev.com/ Info: http://www.xworlds.com/metacard/mailinglist.htm Please send bug reports to [EMAIL PROTECTED], not this list. Archives: http://www.mail-archive.com/metacard@lists.runrev.com/ Info: http://www.xworlds.com/metacard/mailinglist.htm Please send bug reports to [EMAIL PROTECTED], not this list.
Re: sockets
On Mon, 27 Aug 2001 Rodney Tamblyn [EMAIL PROTECTED] wrote: Some socket questions: When using sockets to read and write I have been using the following approach: write the length of the packet on a line followed by the data, at receiving end read for one line, then read for the supplied number of characters. What approaches do others use? You can also read without specifying a for condition, a specified handler will be called when data arrives. Are there any advantages/disadvantages of one approach over the other? The simpler read from socket x with message y is much more efficient, and is the *only* reasonable way to use sockets that will be exchanging large amounts of data or when communicating with a large number of other hosts. I find it more convenient even for smaller-scale development because as long as the host on the other end always writes a complete message (and as long as it's less than 4K in length), you don't have to worry about this length/data problem: all the data they wrote in a single write command will come in with the message. In general, if you have two stacks that are going to have an ongoing series of communications going backwards and forwards, is it better to leave the socket open, or always close the socket after each communication. I've assumed the latter. Definitely: setup time for a TCP socket is pretty large, so you want to leave a socket open as long as there's any chance that you'll need to read or write to it later (this is the issue behind the Keep-Alive extension to the HTTP that was the big feature added for version 1.1 of that protocol). Note that socketTimeout messages will be sent periodically if the socket is inactive for the amount of time specified in the socketTimeoutInterval property. You can either just ignore them or use them as a cue to close the socket and notify the user that something has gone wrong. Presumably there is a limit on the number of sockets MC can have open? Yes, but it depends on the OS and even on how a particular system is set up. A generally-safe lower bound is 20. When MC has an open socket, does it periodically attempt to verify whether the remote party is still present? No, TCP does that automatically. When the connection is dropped at the other end (or someplace in the middle ;-) MetaCard will get an event that will result in a socketClosed or socketError message being sent, depending on exactly what happened. Any other comments or tips from people who are experienced using sockets in Metacard would be appreciated. The libURL script is getting to be a little large to use as a source of examples, but it wouldn't hurt to browse through it. I also have a little telnet client that I'd be willing to send to anyone who needs examples of how to communicate with a telnet server or to get a general idea of how two hosts can communicate. Regards, Scott Rodney -- -- Rodney Tamblyn Educational Media group Higher Education Development Centre, 75 Union Place University of Otago, PO Box 56, Dunedin, New Zealand ph +64 3 479 7580 Fax +64 3 479 8362 http://hedc.otago.ac.nz ~ http://rodney.weblogs.com Scott Raney [EMAIL PROTECTED] http://www.metacard.com MetaCard: You know, there's an easier way to do that... Archives: http://www.mail-archive.com/metacard@lists.runrev.com/ Info: http://www.xworlds.com/metacard/mailinglist.htm Please send bug reports to [EMAIL PROTECTED], not this list.
sockets
I have been having fun working with sockets in Metacard, and in general everything seems to work fine. Some socket questions: When using sockets to read and write I have been using the following approach: write the length of the packet on a line followed by the data, at receiving end read for one line, then read for the supplied number of characters. What approaches do others use? You can also read without specifying a for condition, a specified handler will be called when data arrives. Are there any advantages/disadvantages of one approach over the other? In general, if you have two stacks that are going to have an ongoing series of communications going backwards and forwards, is it better to leave the socket open, or always close the socket after each communication. I've assumed the latter. Presumably there is a limit on the number of sockets MC can have open? When MC has an open socket, does it periodically attempt to verify whether the remote party is still present? Any other comments or tips from people who are experienced using sockets in Metacard would be appreciated. Rodney -- -- Rodney Tamblyn Educational Media group Higher Education Development Centre, 75 Union Place University of Otago, PO Box 56, Dunedin, New Zealand ph +64 3 479 7580 Fax +64 3 479 8362 http://hedc.otago.ac.nz ~ http://rodney.weblogs.com Archives: http://www.mail-archive.com/metacard@lists.runrev.com/ Info: http://www.xworlds.com/metacard/mailinglist.htm Please send bug reports to [EMAIL PROTECTED], not this list.
RE: Interconnecting Metacard apps via sockets...
Using different ports per stack could help here... Rest to manage which stack uses which port... Just an idea... -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On Behalf Of David Bovill Sent: Wednesday, August 15, 2001 16:17 To: [EMAIL PROTECTED] Subject: Re: Interconnecting Metacard apps via sockets... From: Geoff Canyon [EMAIL PROTECTED] Subject: Re: Interconnecting Metacard apps via sockets... At 10:04 PM +0100 8/14/01, David Bovill wrote: I am looking for a way to interconnect apps running on the same machine (on any platform), and thinking of using sockets. I will be programming the basic modules in MC, but want to leave the door open for modules to be coded in other languages, and on other machines... Why are the apps separate if they are talking on the same computer? Why not incorporate one into the other? I want to create an environment where the apps don't care where the programmes are - and where central server resources can be customised using local applications. The environment also needs to allow programmes other than those written in MC to communicate - hence sockets. I kinda know what I want to do - create (or use) a socket/http router with a DNS type local database. Any comments on this idea - anyone done it? Archives: http://www.mail-archive.com/metacard@lists.runrev.com/ Info: http://www.xworlds.com/metacard/mailinglist.htm Please send bug reports to [EMAIL PROTECTED], not this list. Archives: http://www.mail-archive.com/metacard@lists.runrev.com/ Info: http://www.xworlds.com/metacard/mailinglist.htm Please send bug reports to [EMAIL PROTECTED], not this list.
Re: Interconnecting Metacard apps via sockets...
At 10:04 PM +0100 8/14/01, David Bovill wrote: I am looking for a way to interconnect apps running on the same machine (on any platform), and thinking of using sockets. I will be programming the basic modules in MC, but want to leave the door open for modules to be coded in other languages, and on other machines... Why are the apps separate if they are talking on the same computer? Why not incorporate one into the other? regards, gc Archives: http://www.mail-archive.com/metacard@lists.runrev.com/ Info: http://www.xworlds.com/metacard/mailinglist.htm Please send bug reports to [EMAIL PROTECTED], not this list.
Interconnecting Metacard apps via sockets...
I am looking for a way to interconnect apps running on the same machine (on any platform), and thinking of using sockets. I will be programming the basic modules in MC, but want to leave the door open for modules to be coded in other languages, and on other machines... Anyone got any tips? Archives: http://www.mail-archive.com/metacard@lists.runrev.com/ Info: http://www.xworlds.com/metacard/mailinglist.htm Please send bug reports to [EMAIL PROTECTED], not this list.
Re: Interconnecting Metacard apps via sockets...
Thanks Richard, the problem is not with how to use sockets in MC, more issue with using and routing socket connections across a variety of platforms. Stuff like: 1) What problems should I expect trying to connect two apps on the same machine (localhost)? 2) Do they have to be separate apps or can I connect stacks via sockets on the same machine? 3) Anyone worked on a software router for socket or HTTP calls? From: Richard Gaskin [EMAIL PROTECTED] Reply-To: [EMAIL PROTECTED] Date: Tue, 14 Aug 2001 10:15:50 -0700 To: [EMAIL PROTECTED] Subject: Re: Interconnecting Metacard apps via sockets... David Bovill wrote: I am looking for a way to interconnect apps running on the same machine (on any platform), and thinking of using sockets. I will be programming the basic modules in MC, but want to leave the door open for modules to be coded in other languages, and on other machines... Anyone got any tips? See the documentation for the new libURL stack included with MetaCard 2.4. -- Richard Gaskin Fourth World Media Corporation Multimedia Design and Development for Mac, Windows, UNIX, and the Web _ [EMAIL PROTECTED] http://www.FourthWorld.com Tel: 323-225-3717 ICQ#60248349Fax: 323-225-0716 Archives: http://www.mail-archive.com/metacard@lists.runrev.com/ Info: http://www.xworlds.com/metacard/mailinglist.htm Please send bug reports to [EMAIL PROTECTED], not this list. Archives: http://www.mail-archive.com/metacard@lists.runrev.com/ Info: http://www.xworlds.com/metacard/mailinglist.htm Please send bug reports to [EMAIL PROTECTED], not this list.
Re: Sockets again
andu, Reading from the socket until empty is *not* the way to go. Try to device a protocol (say like http) where you give the server a more reliable parameter for its read, like the size of the message or some character that would mark the end of it. Also you can make use of socketClosed() to find out when the other side disconnected (it returns the ip address as parameter). Well, thanks for the info, but actually socketClosed() isn't documented anywhere (MC or Rev), and furthermore it doesn't work (at least on MC 2.3.2 for Mac)... Any other idea ? JB Archives: http://www.mail-archive.com/metacard@lists.runrev.com/ Info: http://www.xworlds.com/metacard/mailinglist.htm Please send bug reports to [EMAIL PROTECTED], not this list.
Sockets again
Hi boys girls, Here comes the sockets thread again. I actually spent the afternoon scripting a small chat program under MC and it works very well between the various machines of our LAN (Macs, Win98 Linux). Now I want to move to larger scale prof. projects : basically a MC app running on a server, and several copies of a client app (on CD-ROM or downloaded straight from a website) opening sockets with the server. Here's how I see the whole thing : - at startup, the server app would run the following script : accept connexions on port 8080 (sorry if the syntax isn't the right one, but you get the idea) then it periodically checks the opensockets property to know how many users are connected - then, each client would open a socket at the IP adress of the server, using the 8080 port. This is the technique I used for the above mentioned chat pgm, and it works perfectly. But 1 question remains in my mind : if a client quits (ie; closes the socket), the only way for the scripts of the server app to know it is to read from that socket until empty, and then the IP address port # of that socket is automatically removed from the opensockets list (but if the script doesn't read from that socket - which I guess clears some buffer - the IP # of that socket remains in the list). In other words, if you don't read from a socket, there's apparently no other way to know if the client has quit or not. I tried to check the peerAddress (naively thinking that it would return empty if the client has quit), but it just freezed the app, and I had to restart... Any more tip / suggestion regarding a more flexible sockets management ? Thanks. JB P.S. in the above described project, several dozens of connections might be opened by clients apps. Isn't it a risk to see the server app slowed down dramatically, and even choke ? Would it be wise to split the task between different servers ? But it that case, how to manage sockets between clients apps the servers (especially on the matter of choosing port numbers) ? Archives: http://www.mail-archive.com/metacard@lists.runrev.com/ Info: http://www.xworlds.com/metacard/mailinglist.htm Please send bug reports to [EMAIL PROTECTED], not this list.
Re: Sockets again
- Original Message - From: jbv [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Friday, May 11, 2001 3:40 PM Subject: Sockets again Hi boys girls, Here comes the sockets thread again. I actually spent the afternoon scripting a small chat program under MC and it works very well between the various machines of our LAN (Macs, Win98 Linux). Now I want to move to larger scale prof. projects : basically a MC app running on a server, and several copies of a client app (on CD-ROM or downloaded straight from a website) opening sockets with the server. Here's how I see the whole thing : - at startup, the server app would run the following script : accept connexions on port 8080 (sorry if the syntax isn't the right one, but you get the idea) then it periodically checks the opensockets property to know how many users are connected - then, each client would open a socket at the IP adress of the server, using the 8080 port. This is the technique I used for the above mentioned chat pgm, and it works perfectly. But 1 question remains in my mind : if a client quits (ie; closes the socket), the only way for the scripts of the server app to know it is to read from that socket until empty, and then the IP address port # of that socket is automatically removed from the opensockets list (but if the script doesn't read from that socket - which I guess clears some buffer - the IP # of that socket remains in the list). In other words, if you don't read from a socket, there's apparently no other way to know if the client has quit or not. OR, the client stack script could contain a closeStackRequest handler that sends a This is me closing now message to the server. Like this: on closeStackRequest open a socket to the server write the bye-bye message close the socket -- be sure to include next line, or stack won't close! pass closeStackRequest end closeStackRequest I tried to check the peerAddress (naively thinking that it would return empty if the client has quit), but it just freezed the app, and I had to restart... Any more tip / suggestion regarding a more flexible sockets management ? Also, you might see what difference it would make if you use UDP connections (accept datagram connections on... and open datagram socket to...). When you use datagrams, the message sent by the client arrives at the server as parameter of the 'open' request, rather than being streamed to it through an established connection between them. Hence the term connectionless. I haven't done my own test, but it might keep things from freezing up over connection status. Thanks. JB P.S. in the above described project, several dozens of connections might be opened by clients apps. Isn't it a risk to see the server app slowed down dramatically, and even choke ? Would it be wise to split the task between different servers ? But it that case, how to manage sockets between clients apps the servers (especially on the matter of choosing port numbers) ? Archives: http://www.mail-archive.com/metacard@lists.runrev.com/ Info: http://www.xworlds.com/metacard/mailinglist.htm Please send bug reports to [EMAIL PROTECTED], not this list. Archives: http://www.mail-archive.com/metacard@lists.runrev.com/ Info: http://www.xworlds.com/metacard/mailinglist.htm Please send bug reports to [EMAIL PROTECTED], not this list.
Re: Sockets again
jbv wrote: Hi boys girls, Here comes the sockets thread again. I actually spent the afternoon scripting a small chat program under MC and it works very well between the various machines of our LAN (Macs, Win98 Linux). Now I want to move to larger scale prof. projects : basically a MC app running on a server, and several copies of a client app (on CD-ROM or downloaded straight from a website) opening sockets with the server. Here's how I see the whole thing : - at startup, the server app would run the following script : accept connexions on port 8080 (sorry if the syntax isn't the right one, but you get the idea) then it periodically checks the opensockets property to know how many users are connected - then, each client would open a socket at the IP adress of the server, using the 8080 port. This is the technique I used for the above mentioned chat pgm, and it works perfectly. But 1 question remains in my mind : if a client quits (ie; closes the socket), the only way for the scripts of the server app to know it is to read from that socket until empty, and then the IP address port # of that socket is automatically removed from the opensockets list (but if the script doesn't read from that socket - which I guess clears some buffer - the IP # of that socket remains in the list). In other words, if you don't read from a socket, there's apparently no other way to know if the client has quit or not. I tried to check the peerAddress (naively thinking that it would return empty if the client has quit), but it just freezed the app, and I had to restart... Any more tip / suggestion regarding a more flexible sockets management ? Reading from the socket until empty is *not* the way to go. Try to device a protocol (say like http) where you give the server a more reliable parameter for its read, like the size of the message or some character that would mark the end of it. Also you can make use of socketClosed() to find out when the other side disconnected (it returns the ip address as parameter). Thanks. JB P.S. in the above described project, several dozens of connections might be opened by clients apps. Isn't it a risk to see the server app slowed down dramatically, and even choke ? Would it be wise to split the task between different servers ? But it that case, how to manage sockets between clients apps the servers (especially on the matter of choosing port numbers) ? Archives: http://www.mail-archive.com/metacard@lists.runrev.com/ Info: http://www.xworlds.com/metacard/mailinglist.htm Please send bug reports to [EMAIL PROTECTED], not this list. Andu Archives: http://www.mail-archive.com/metacard@lists.runrev.com/ Info: http://www.xworlds.com/metacard/mailinglist.htm Please send bug reports to [EMAIL PROTECTED], not this list.
Re: multiple sockets to the same address:port
Robin-David Hammond wrote: It looks like the close sockets function does not accept the name of the socket, but the host:port pair. this would make opening multiple sockes to the same port rather difficult. I'm not sure about 2.3.x but in 2.4 you can number each socket like: 1.2.3.4:80|1 and 1.2.3.4:80|2... can someone please confirm/deny? - Robin-David Hammond 56 Hardwick RD Ashland MASS, USA Contrary to popular belief, penguins are not the salvation of modern technology. Neither do they throw parties for the urban proletariat. Andu Archives: http://www.mail-archive.com/metacard@lists.runrev.com/ Info: http://www.xworlds.com/metacard/mailinglist.htm Please send bug reports to [EMAIL PROTECTED], not this list.
Sockets info
I've been seeing a lot of references to sockets on the list. This is one topic (among many) that I am completely ignorant of. Can someone point me to a book or site where I could read up on then and how to use them? Philip Archives: http://www.mail-archive.com/metacard@lists.runrev.com/ Info: http://www.xworlds.com/metacard/mailinglist.htm Please send bug reports to [EMAIL PROTECTED], not this list.
Re: Sockets info
I've been seeing a lot of references to sockets on the list. This is one topic (among many) that I am completely ignorant of. Can someone point me to a book or site where I could read up on then and how to use them? Unfortunately "sockets" hardly describes what it actually is and does in this context. Generally speaking opening, reading/writing and closing sockets are the basic operations which allow for transmitting/receiving data between 2 computers (local network or internet). You open a socket to an address (say, http://www.metacard.com on port 80) and you write a request for a file (say, index.html). The computer at the other end "listens" for requests on port 80 and when "index.html" comes in it writes the file (index.html) to the socket you opened. Next, you read from the socket the other computer's reply and optionally close the socket. Then you do whatever you want with the data received. Philip Regards, Andu ___ [EMAIL PROTECTED] Archives: http://www.mail-archive.com/metacard@lists.runrev.com/ Info: http://www.xworlds.com/metacard/mailinglist.htm Please send bug reports to [EMAIL PROTECTED], not this list.
Re: Sockets info
On 3/23/01 2:18 AM, [EMAIL PROTECTED] wrote: I've been seeing a lot of references to sockets on the list. This is one topic (among many) that I am completely ignorant of. Can someone point me to a book or site where I could read up on then and how to use them? Socket discussions appear more frequently nowadays, but the actual persons involved on the discussions are rather few (and andu is the most active person on this topic of all ;-) Writing socket might be too complicated for xTalk developer - but it is getting more and more important for sure. I wish there is a dedicated site for socket discussions and code exchange but I've doubted how many of us will benefit for it. The best way to start is to perform an autopsy on andu's httpd stack, but again even I have written a similar stack, I was having problem to understand the stack by first glance. Good luck! Philip Regards, LiangTyan Fui Archives: http://www.mail-archive.com/metacard@lists.runrev.com/ Info: http://www.xworlds.com/metacard/mailinglist.htm Please send bug reports to [EMAIL PROTECTED], not this list.
Re: Sockets info
On 3/23/01 2:18 AM, [EMAIL PROTECTED] wrote: I've been seeing a lot of references to sockets on the list. This is one topic (among many) that I am completely ignorant of. Can someone point me to a book or site where I could read up on then and how to use them? Socket discussions appear more frequently nowadays, but the actual persons involved on the discussions are rather few (and andu is the most active person on this topic of all ;-) Writing socket might be too complicated for xTalk developer - but it is getting more and more important for sure. It shouldn't be complicated specially with the few examples that exist. The more time consuming and frustrating task is getting a grip on different protocols and dealing with the way some developers "chose" to implement them. I think the reluctance people have in dealing with sockets comes rather from the opacity of MacOS and Windows to such matters where all you have to do is fill out some fields in a control panel and go. This is perfectly fine for most people but developers and authors ought to make the effort to know a little more. I wish there is a dedicated site for socket discussions and code exchange but I've doubted how many of us will benefit for it. Simon Lord started something... and I do think it could've helped a lot: some sample scripts, the more important RFCs at hand, experiments with new protocols, etc.. The best way to start is to perform an autopsy on andu's httpd stack, but again even I have written a similar stack, I was having problem to understand the stack by first glance. Unfortunately I took the good habit of commenting my scripts only recently so I am to be blamed for not making things easier for others. Good luck! Philip Regards, LiangTyan Fui Archives: http://www.mail-archive.com/metacard@lists.runrev.com/ Info: http://www.xworlds.com/metacard/mailinglist.htm Please send bug reports to [EMAIL PROTECTED], not this list. . Regards, Andu ___ [EMAIL PROTECTED] Archives: http://www.mail-archive.com/metacard@lists.runrev.com/ Info: http://www.xworlds.com/metacard/mailinglist.htm Please send bug reports to [EMAIL PROTECTED], not this list.
Re: Sockets vs. POST
This is the sort of thing that you need to do with matching genetic sequences, so I'm sure the algorithms are out there ... Sounds like a job for GREP! (which MetaCard does natively) I think it's a bit more complicated than that -:) I mean before you start testing you don't know what to match with what - where do you start? This has been sorted out, so I figure it's not worth thinking about too hard. Best probably to wait for Xavier to come back with an algorithm (if he's listening -:) NB: five times the hosting costs for a dedicated server works out the same price for 5 people if my maths is right. If you include me that leaves 3 more @ $20 a month. What are you driving at? Ford Mondeo? I surmise that you are suggesting that five people get together and pitch in 20$ each pr month, for hosting services from a dedicated server. Is this correct? Will this service-provider host MetaCard CGI programs? Any restrictions? ... More details please. Collocation - there are quite a few major providers offering a dedicated raq server, running Linux for $99 a month. So yes to all the above. For CGI hosting, Simon Lord is setting up a service for Metacard CGI's, and if I remember correctly accounts start are arranged geometrically at around $12.50 a month. Running your own dedicated MC server with the ability to define your own ports and nice simple protocols is another matter - for this you have to have a dedicated server (not a shared solution). As above these come in bigger chunks (ie around 5 times the price of a shared solution). This usually includes around 5 times the disk space, and dedicated processing power, but not a lot of help (you deal with it your self remotely). I don't have personal experience running one of these, so anyone please chip in and correct me... Archives: http://www.mail-archive.com/metacard@lists.runrev.com/ Info: http://www.xworlds.com/metacard/mailinglist.htm Please send bug reports to [EMAIL PROTECTED], not this list.
RE: Sockets vs. POST
Collocation - there are quite a few major providers offering a dedicated raq server, running Linux for $99 a month. I'm in ;-) But there is also a cheaper company than this. For 25 pounds (after a setup fee) a company named UK2.net will give you a dedicated 10.2 GB Cobalt Raq3 server. What would that be $40-45? Archives: http://www.mail-archive.com/metacard@lists.runrev.com/ Info: http://www.xworlds.com/metacard/mailinglist.htm Please send bug reports to [EMAIL PROTECTED], not this list.
Re: Sockets vs. POST
While working on some routines to send POST data to CGIs, I'm having some trouble getting the data in the right format... What kind of trouble? Trouble with extracting the posted data ? Trouble with the encoding of 8-bit ASCII chars ? 1. Would it be any easier to take control over the whole transaction by using sockets instead of relying on MC's POST? My first hunch is that it would not... Your hunch is correct. Sockets are much more complicated because they are at a lower level of abstraction, e.g. more details to attend to than would normally be the case when the process is handled for you. ... but it's been a bear dealing with some CGIs. I recommend you duke it out with the CGI protocol some more before giving up on this relatively easy protocol. Unless, of course, you have some very special protocol needs that CGI is not designed to handle or to handle-well. IOW, with sockets, you could create your own custom communication protocol. A protocol that doesn't have all of the un-necessary overhead of CGI, for example. You could conceivably create a protocol custom-made for MetaCard stacks to communicate via the Internet in their own native-tongue. Just a random thought ;-) Alain Farmer mailto:[EMAIL PROTECTED] __ Get your own FREE, personal Netscape Webmail account today at http://webmail.netscape.com/ Archives: http://www.mail-archive.com/metacard@lists.runrev.com/ Info: http://www.xworlds.com/metacard/mailinglist.htm Please send bug reports to [EMAIL PROTECTED], not this list.
Re: Sockets vs. POST
While working on some routines to send POST data to CGIs, I'm having some trouble getting the data in the right format... What kind of trouble? Trouble with extracting the posted data ? Trouble with the encoding of 8-bit ASCII chars ? Mostly that the server is reporting that the header contains invalid data. Yesterday's error was that I'm missing a semicolon somewhere, but in reviewing the Interarchy dump I can't find a semicolon present when I use a browser that is not present when I make the same call from MC. :( 1. Would it be any easier to take control over the whole transaction by using sockets instead of relying on MC's POST? My first hunch is that it would not... Your hunch is correct. Sockets are much more complicated because they are at a lower level of abstraction, e.g. more details to attend to than would normally be the case when the process is handled for you. That's encouraging. It seems silly to reproduce the whole protocol just because of header errors. ... but it's been a bear dealing with some CGIs. I recommend you duke it out with the CGI protocol some more before giving up on this relatively easy protocol. Unless, of course, you have some very special protocol needs that CGI is not designed to handle or to handle-well. IOW, with sockets, you could create your own custom communication protocol. A protocol that doesn't have all of the un-necessary overhead of CGI, for example. You could conceivably create a protocol custom-made for MetaCard stacks to communicate via the Internet in their own native-tongue. If only. For this project I need to perform the same calls that a browser makes, only from MC instead of a browser. For all other projects, I'd love to use MC on the server side as well, but I haven't found a shared hosting service that will let me do that. If the only alternative is to quintuple my hosting costs with colocation I'd rather just continue using Perl. -- Richard Gaskin Fourth World Media Corporation Multimedia Design and Development for Mac, Windows, UNIX, and the Web _ [EMAIL PROTECTED] http://www.FourthWorld.com Tel: 323-225-3717 ICQ#60248349Fax: 323-225-0716 Archives: http://www.mail-archive.com/metacard@lists.runrev.com/ Info: http://www.xworlds.com/metacard/mailinglist.htm Please send bug reports to [EMAIL PROTECTED], not this list.
Re: Sockets vs. POST
From: Richard Gaskin [EMAIL PROTECTED] Reply-To: [EMAIL PROTECTED] Date: Fri, 02 Mar 2001 12:44:10 -0800 To: [EMAIL PROTECTED] Subject: Re: Sockets vs. POST What kind of trouble? Trouble with extracting the posted data ? Trouble with the encoding of 8-bit ASCII chars ? Mostly that the server is reporting that the header contains invalid data. Yesterday's error was that I'm missing a semicolon somewhere, but in reviewing the Interarchy dump I can't find a semicolon present when I use a browser that is not present when I make the same call from MC. :( What would be really nice is to have something which would analyse tow text files and colourize the bits that differed. This is the sort of thing that you need to do with matching genetic sequences, so I'm sure the algorithms are out there (Xavier -:), but an nice scriptable app would be a boon. Anyone know of one? NB: five times the hosting costs for a dedicated server works out the same price for 5 people if my maths is right. If you include me that leaves 3 more @ $20 a month. I remember reading this thing about those "freeways" in the States, where everyone drives the same speed? Well in California apparently they closed one of the lanes to everyone - save those cars with 4 or more people in them; worked a treat with those willing to share zipping along - getting to work much faster. Any Californians out there? Archives: http://www.mail-archive.com/metacard@lists.runrev.com/ Info: http://www.xworlds.com/metacard/mailinglist.htm Please send bug reports to [EMAIL PROTECTED], not this list.
Sockets vs. POST
While working on some routines to send POST data to CGIs, I'm having some trouble getting the data in the right format and it's raise two questions: 1. Would it be any easier to take control over the whole transaction by using sockets instead of relying on MC's POST? My first hunch is that it would not, but it's been a bear dealing with some CGIs. 2. Is there any better tool for Mac OS which will let me review all outging and incoming data on port 80 than Interarchy? I find the format of Interarchy's stream dumps awfully noisy, with no evident options for reducing the displayed info to just the stream without all the commentary junk. Thanks in advance - -- Richard Gaskin Fourth World Media Corporation Multimedia Design and Development for Mac, Windows, UNIX, and the Web _ [EMAIL PROTECTED] http://www.FourthWorld.com Tel: 323-225-3717 ICQ#60248349Fax: 323-225-0716 Archives: http://www.mail-archive.com/metacard@lists.runrev.com/ Info: http://www.xworlds.com/metacard/mailinglist.htm Please send bug reports to [EMAIL PROTECTED], not this list.
Re: Sockets vs. POST
michael kann a crit : I've been using HTTPtracer on Windows to monitor HTTP traffic. It is one of the best designed programs I've ever used. When POSTING data to PWS/ASP/Access I noticed that I could POST from Netscape/Microsoft but not from Metacard. With HTTPtracer I discovered that the POST from Netscape/Microsoft actually goes in two parts. First it POSTS the headers, then it POSTS the data, in a following message. I concluded that Metacard just POSTS once, so the data doesn't get through. Thank's Michael :-) If so, the sockets approach is probably, as Andu wrote previously, the onest way to use to handle "POST" method from within mc. Regards, Pierre --- Richard Gaskin [EMAIL PROTECTED] wrote: While working on some routines to send POST data to CGIs, I'm having some trouble getting the data in the right format and it's raise two questions: 1. Would it be any easier to take control over the whole transaction by using sockets instead of relying on MC's POST? My first hunch is that it would not, but it's been a bear dealing with some CGIs. 2. Is there any better tool for Mac OS which will let me review all outging and incoming data on port 80 than Interarchy? I find the format of Interarchy's stream dumps awfully noisy, with no evident options for reducing the displayed info to just the stream without all the commentary junk. __ Do You Yahoo!? Get email at your own domain with Yahoo! Mail. http://personal.mail.yahoo.com/ Archives: http://www.mail-archive.com/metacard@lists.runrev.com/ Info: http://www.xworlds.com/metacard/mailinglist.htm Please send bug reports to [EMAIL PROTECTED], not this list. -- Pierre Sahores WEB VPN applications and databases servers Inspection acadmique de la Seine-Saint-Denis Qualifier et produire l'avantage comptitif Archives: http://www.mail-archive.com/metacard@lists.runrev.com/ Info: http://www.xworlds.com/metacard/mailinglist.htm Please send bug reports to [EMAIL PROTECTED], not this list.
Re: Sockets vs. POST
Richard Gaskin wrote: While working on some routines to send POST data to CGIs, I'm having some trouble getting the data in the right format and it's raise two questions: 1. Would it be any easier to take control over the whole transaction by using sockets instead of relying on MC's POST? Absolutely, you can send a more standards compliant header which some servers may require. Michael Kann thinks that posting the header first makes any difference which I doubt: it appears that way because of the double empty space between the header and body. Make sure you have a crlf after each line in the header and double crlf between the header and body. My first hunch is that it would not, but it's been a bear dealing with some CGIs. 2. Is there any better tool for Mac OS which will let me review all outging and incoming data on port 80 than Interarchy? I find the format of Interarchy's stream dumps awfully noisy, with no evident options for reducing the displayed info to just the stream without all the commentary junk. Interarchy allows you to uncheck any "stuff" you don't want to see: the minimum is data in ascii and hex (on the left side). Thanks in advance - -- Richard Gaskin Andu Archives: http://www.mail-archive.com/metacard@lists.runrev.com/ Info: http://www.xworlds.com/metacard/mailinglist.htm Please send bug reports to [EMAIL PROTECTED], not this list.
Re: Simple Sockets?
On 1/2/01 1:44 AM, Peter Reid wrote: Hi I'm just starting to experiment with very simple sockets for message between two computers on the same TCP/IP LAN. I'm taking the scripts posted by Kevin on 6 Nov and Mark on 1 Jan as my starting point. I'm hoping to use the same stack on both computers, each acting as both a host and a client. Here are some simple/stupid questions: 1) is there a reverse of the "accept" command, i.e. the facility to stop the host from accepting connections? Close the port that you have "accept" on. eg: accept connections on port "8080" with message "sockOpen" close socket "8080" 2) is there any way of finding out the IP address of the current computer a stack is running on without making a socket connection to another machine? Not that I know. Regards, LiangTyan Fui Thanks to both Kevin and Mark for helping me to get started in this area! Thanks for any help. Peter Archives: http://www.mail-archive.com/metacard@lists.runrev.com/ Info: http://www.xworlds.com/metacard/mailinglist.htm Please send bug reports to [EMAIL PROTECTED], not this list.
Re: Simple Sockets?
Peter Reid asked -- is there any way of finding out the IP address of the current computer a stack is running on without making a socket connection to another machine? -- on Windows98 I've had success with the following: on mouseUp put empty into fld "ipconfigfld" set hideConsoleWindows to true put shell("ipconfig") into vtemp filter vtemp with "*IP*" put last word of vtemp into fld "ipconfigfld" end mouseUp __ Do You Yahoo!? Yahoo! Photos - Share your holiday photos online! http://photos.yahoo.com/ Archives: http://www.mail-archive.com/metacard@lists.runrev.com/ Info: http://www.xworlds.com/metacard/mailinglist.htm Please send bug reports to [EMAIL PROTECTED], not this list.
Sockets Made Easy .. sort of
Since I have been mucking around with sockets (as others on this list have), I decided to make a simple stack that acted as both a client and a server and could send any data between the two. My current plan is to make it a stack that can act as a library so I can use it at either end and make updates to it without messing with the rest of my stacks. In its current form, it lets you send data up to the stack acting as a server, send a simple command to request data from the server, and to send a file to the server. (remember, its the same stack, just running on two machines...and you hit "start server" on one). The conversation between the two continues until the client or server says "OK"...so the server can send error messages or whatever back to the client. Feel free to use it, take it apart, make it better (lots of room).it should be a pretty good intro for someone who is just learning sockets, but also useful for someone who doesnt want to learn too much about them (and just wants to move small blocks of data between stacks). I'll post the library stack once I figure it out for my purposes. Detailed instructions are on the page...but in summary...open it on two computers, click on start server on one, type the IP of the server into the client, then send some data! Download from: http://www.tenet.edu/teks/language_arts/testsite/downloads/mc/mc.html Let me know what you think. Mark J. Luetzelschwab [EMAIL PROTECTED] Graduate Research Assistant (v) (512) 232 6034 Instructional Technology(f) (512) 232 2322 Reading and Language Arts: http://www.texasreading.org Archives: http://www.mail-archive.com/metacard@lists.runrev.com/ Info: http://www.xworlds.com/metacard/mailinglist.htm Please send bug reports to [EMAIL PROTECTED], not this list.
RE: sockets: a revelation
ok, but how do you read the info or request it? suppose you know the ip and port to use only? does anyone have an explanation about how to read datagrams? how do you discover the protocol? is this necessary? for example, i'd like to list quake servers available... how do you go about finding this out? i've searched for possible info on the web but it's too polluted with scripts, tricks and tweaks... a url will do surely! im not refering to cgi's btw. Thanks Xavier -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On Behalf Of Monte Goulding Sent: Saturday, November 04, 2000 5:02 PM To: [EMAIL PROTECTED] Subject: Re: sockets: a revelation Hi This may be a bit off your topic but it's still about sockets. I have never played with this so am just asking through curiosity. My field of study and work is in Exercise and Sports Science. In this field (and may others I might add) there are a lot of gadgets as you would understand that fit to port. Is it possible to read directly from these gadgets or is this only possible if you know the messages they are sending. Is this legal if it side-steps software designed buy the manufacturer of the gadget. I would be quite interested to find out this kind of info for future reference. I am really not up to it yet. Regards Monte From: Dave Cragg [EMAIL PROTECTED] Reply-To: [EMAIL PROTECTED] To: [EMAIL PROTECTED] Subject: sockets: a revelation Date: Fri, 3 Nov 2000 14:16:48 + Hi all, Sorry for this rambling mail, but I just had one of those "see the light" experiences that leaves you feeling both like a genius and an idiot at the same time. Like others I guess, I've been trying to get to grips with the new sockets features of Metacard, and seeing how these can be used for various internet/intranet purposes. So I've been doing some reading up of various internet protocols and tried to implement some client-side http as part of this. Anyway, all this attention to web protocols seems to have blinded me to the basic concept of sockets. I've been approaching the whole thing with the premise that it's necesary to use established protocols (ftp, http, etc.) to use sockets. However, it just came to me that client and server programs can communicate any way they like, as long as they can understand each other. I have to thank Brian (Yennie) of this list for this "discovery". While browsing some old mails, I came across his scripts for checking whether a computer was still online or not. I couldn't believe it was that simple. ("accept connections on port 8080 with message whatever" and your server application is running. Come on, Scott! This is embarrassingly easy. Who's going to take this seriously? :)) I can see the importance of implementing established protocols if you need to communicate widely, for example, to apache servers from client Metacard programs or with web browsers from a Metacard server program. However, my interest is with more restricted applications. In particualr, with intranet-based training programs where a single Metacard client program has to communicate with an intranet server program to process results , be served lessons, tests, etc. Instead of grappling with cgi scripting, web protocols and the like, it seems all I have to do is put a Metacard program on an accessible machine, set it to accept connections, and then basically implement a set of matching read/write handlers at the client and server ends. A private protocol, so to speak. So my questions: Is it really this easy, in principle at least? What are the pitfalls? Is Metacard ready for the big time in this regard? (I.e. will it run all day on a server?) Aplogies if all this is blindingly obvious. Cheers Dave Cragg Archives: http://www.mail-archive.com/metacard@lists.runrev.com/ Info: http://www.xworlds.com/metacard/mailinglist.htm Please send bug reports to [EMAIL PROTECTED], not this list. _ Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com. Share information about yourself, create your own public profile at http://profiles.msn.com. Archives: http://www.mail-archive.com/metacard@lists.runrev.com/ Info: http://www.xworlds.com/metacard/mailinglist.htm Please send bug reports to [EMAIL PROTECTED], not this list. Archives: http://www.mail-archive.com/metacard@lists.runrev.com/ Info: http://www.xworlds.com/metacard/mailinglist.htm Please send bug reports to [EMAIL PROTECTED], not this list.