Socket communication
Ralph DiMola
rdimola at evergreeninfo.net
Tue Nov 22 17:55:50 EST 2016
Richard/Alex,
Thanks!!! As Phil said "Live and learn". The LC example did work because it
closes all open sockets, I just did not know why it worked.
Ralph DiMola
IT Director
Evergreen Information Services
rdimola at evergreeninfo.net
-----Original Message-----
From: use-livecode [mailto:use-livecode-bounces at lists.runrev.com] On Behalf
Of Alex Tweedly
Sent: Tuesday, November 22, 2016 5:04 PM
To: use-livecode at lists.runrev.com
Subject: Re: Socket communication
Yes, what Richard said :-)
Don't be misled by the dictionary - the socketID *may* start with an IP
address, but it doesn't need to - therefore you can simply
close 8765
without an IP address, to close sockets you have 'accepted' on.
-- Alex.
On 22/11/2016 21:52, Richard Gaskin wrote:
> Ralph DiMola wrote:
>
> > When one enables socket communication on the server side using the
> > form "accept [datagram] connections on port portNumber with message
> > callbackMessage", how do you stop accepting new connections?
> > The LC lesson show closing all open sockets but not how to prevent
> > new connections.
>
> After running "accept", check the openSockets. You should see one
> which has no IP address, and is just the port number you're listening
> on, e.g.:
>
> accept connections on port 4444 with message "foo"
> put the openSockets
>
> ..should yield:
>
> 4444
>
> If you then close that you should be unable to receive further
> connections:
>
> close socket 4444
>
_______________________________________________
use-livecode mailing list
use-livecode at lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
More information about the use-livecode
mailing list