How to use sockets?

Eric Wild wild at noos.fr
Thu Nov 11 11:04:40 EST 2004


A question about datagrams.
Is there a special reason to close the socket after each accept or 
write command instead of letting it open for further messages?

Thanks, Eric.


Le 10 nov. 04, à 15:31, Björnke von Gierke a écrit :

>
>
> With datagram sockets you don't need to care about delimiters, also 
> the connection scheme is simpler, as you normally don't use as much 
> callback messages:
>
> --server button:
> on mouseUp
>   accept datagram connections on port 8181 with message "Connected"
>   close socket theIP
> end mouseUp

> on connected theIP theMessage
>   put theMessage after field "Your field here"
> end connected
>
> --client field:
> on returnInField
>   open datagram socket to "localhost:8181"
>   write the text of me & return to socket "localhost:8181"
>   close socket "localhost:8181"	
> end returnInField
>



More information about the use-livecode mailing list