Socket Comm Sequence Issue

Ken Ray kray at sonsothunder.com
Fri Apr 15 11:07:50 EDT 2005


On 4/15/05 8:29 AM, "Frank D. Engel, Jr." <fde101 at fjrhome.net> wrote:

> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
> 
> Sockets are already bidirectional, the trick is to know when which
> program should read data.  Set up one to listen then connect from the
> other.
> 
> It turns out that 'read from socket' can be used asynchronously.  You
> can have the handler which executes as a callback trigger another read
> each time in order to set up pseudo-threading of a sort, allowing your
> program to offer bidirectional communication over a single socket.
> That should solve your problem.

Can you show me an example? The reason I ask is that although I know I can
do a read (and sequential reads) after App 2 opens a connection with "open
socket", but the socket that it reads from is the same as the one that was
opened (127.0.0.1:59999 below), NOT the socket that is *created* by App 1's
"accept connections" (127.0.0.1:50013 below).

So an example would really be appreciated...

Ken Ray
Sons of Thunder Software
Web site: http://www.sonsothunder.com/
Email: kray at sonsothunder.com




More information about the use-livecode mailing list