How to use sockets?

thierry douez at wanadoo.fr
Wed Nov 10 05:42:59 CST 2004


Hi,

BvG> On Nov 07 2004, at 23:46, DJ Grumble wrote:

BvG> note: this is the hard way, with datagramm sockets its way simpler, but 
BvG> that's the way i would do it :)


out of curiosity :-) what would be simpler with Datagramm ?????

otherwise, can someone tell me the pros and cons of communicating
between revolution and an outside program using "the open process" versus
open socket
( the outside program reads few properties
from revolution during the execution and then write to some others...  )

please, nothing to do with the shell() command.

the environment is Win98, NT and XP

regards, thierry



BvG> --server button:
BvG> on mouseUp
BvG>    accept connections on port "8181" with message "incomming"
BvG> end mouseUp

BvG> on incomming remoteIP
BvG>    read from socket remoteIP until return with message "gotOne"
BvG> end incomming

BvG> on gotOne remoteIP theMessage
BvG>    put theMessage  into field "Your field here"
BvG>    close socket remoteIP
BvG> end gotOne

BvG> --client field:
BvG> on returnInfield
BvG>    open socket "localhost:8181" with message "contacted"
BvG> end returninfield

BvG> on contacted theIP
BvG>    write the text of me & return to socket theIP
BvG> end contacted




More information about the use-livecode mailing list