Suggestions?

Mikey mikeythek at gmail.com
Wed Mar 9 09:04:50 EST 2005


Since this type of issue is not uncommon, noob will chime in with what
works in other environments:

1) Using database communication
ADVANTAGES: Most of the overhead is handled at a higher level.  The
actual network communication is not your concern.  Everybody
(including your "availability" stack, i.e. the central stack that
passes out the tokens) is accessing the DB on the back.  The ethernet
cards take care of the rest.  Also, if the central server/availability
stack wonks, restarting gets you back to an intermediate state
immediately.  If you haven't written tcp/ip communication code before,
this is probably the option for you.  It is more elegant, and would be
more in line with the RR philosophy of higher-level programming.
DISADVANTAGES: Slower, generally speaking, and record locking can
become an issue - you either have records locked at inconvenient
times, or you have no locking and potential indeterminate states. 
Plus your central machine can't be an old piece of junk.

2) Using direct communication via sockets
ADVANTAGES: Depending on the socket type you use, you can increase
speed dramatically.  UDP, being of lower overhead than TCP, enables
fast communication.  TCP allows multiple sockets to be open and left
open, meaning that you have dedicated pipes to and from each client. 
Since you control the communications you can do all kinds of things
like two-way pings, etc.
DISADVANTAGES: Using UDP (if you so choose) does not guarantee that
communication will take place between machines, as UDP is stateless. 
If you don't NEED to have machines ping each other every 30 seconds,
i.e. in the event that no communication occurs you assume that the
state has not changed, then this not a problem.  Regardless of whether
you use UDP or TCP, you have to write all the communication crap
yourself.  If you've never written your own tcp protocol or if you've
never written any communication code this can be a bit annoying.  If
you decide to change the way your communications work then you have to
change it everywhere.

-- 
On the first day, God created the heavens and the Earth
On the second day, God created the oceans.
On the third day, God put the animals on hold for a few hours,
   and did a little diving.
And God said, "This is good."


More information about the use-livecode mailing list