Socket 'netiquette'

Troy Rollins troy at
Tue Mar 12 22:02:01 EST 2002

On Tuesday, March 12, 2002, at 09:11 PM, JohnRule at wrote:

>  Opening sockets to other computers (TCP) seems to require that you 
> close the
> socket after each send. This seems fast enough to do very quick 'open' 
> and
> 'close' calls, but it seems like a lot of overhead to me.
This is not always true. That behavior is typical of UDP and other types 
of "messaging", but very frequently client/server scenarios maintain 
connections on a socket.

>  Openning sockets to other devices do not seem to require this (more
> forgiving I guess). I can leave a socket open on custom device I am 
> designing
> all day long (and all night actually), and neither the PC nor the 'box' 
> seem
> to mind.
This is true. It is extremely typical to maintain socket connects to 
"non-standard" devices. Maintaining a connection should cause no 
problems (or sure hasn't in my experience). However, many such devices 
may have an internal time-out on their connections (apparently yours 
don't), but frequently you must script to support that.

>  It seems to take a long time to open the socket the first time, and 
> then
> subsequent calls are very fast.
Connection time is pretty device specific - I've seen a full gamut of 
ranges for this.
>  I am hoping someone more knowledgeable than me will reprimand me for
> anything I may be doing wrong (or confirm anything I am doing right).

More knowledgeable? Not sure... but experience says you are doing OK 
with your thinking.

It sounds like you are having some fun. :)

More information about the use-livecode mailing list