RE: Socket communication
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 rdim...@evergreeninfo.net -Original Message- From: use-livecode [mailto:use-livecode-boun...@lists.runrev.com] On Behalf Of Alex Tweedly Sent: Tuesday, November 22, 2016 5:04 PM To: use-livecode@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 with message "foo" > put the openSockets > > ..should yield: > > > > If you then close that you should be unable to receive further > connections: > >close socket > ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode
Re: Socket communication
Live and learn! Phil On 11/22/16 2:04 PM, Alex Tweedly wrote: 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 with message "foo" put the openSockets ..should yield: If you then close that you should be unable to receive further connections: close socket ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode -- Phil Davis ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode
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 with message "foo" put the openSockets ..should yield: If you then close that you should be unable to receive further connections: close socket ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode
Re: Socket communication
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 with message "foo" put the openSockets ..should yield: If you then close that you should be unable to receive further connections: close socket -- Richard Gaskin Fourth World Systems Software Design and Development for the Desktop, Mobile, and the Web ambassa...@fourthworld.comhttp://www.FourthWorld.com ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode
Re: Socket communication
For clarity, it would be nice to have a "stop accepting connections on port x" command. Phil On 11/22/16 1:31 PM, Phil Davis wrote: That's a really good question Ralph! Maybe you could put the 'accept' and 'callbackMessage' code in a script that can be put into use / taken out of use and that would do it, but I haven't tried it. Phil Davis On 11/22/16 1:11 PM, 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. Thanks! Ralph DiMola IT Director Evergreen Information Services rdim...@evergreeninfo.net ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode -- Phil Davis ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode
Re: Socket communication
That's a really good question Ralph! Maybe you could put the 'accept' and 'callbackMessage' code in a script that can be put into use / taken out of use and that would do it, but I haven't tried it. Phil Davis On 11/22/16 1:11 PM, 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. Thanks! Ralph DiMola IT Director Evergreen Information Services rdim...@evergreeninfo.net ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode -- Phil Davis ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode
Socket communication
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. Thanks! Ralph DiMola IT Director Evergreen Information Services rdim...@evergreeninfo.net ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode