polling only on socket, or can there be a trigger?

Mark Waddingham mark at livecode.com
Sat May 9 15:09:20 EDT 2015


> Just using the accept connections will get you that.  The message sent 
> is
> in the form of 127.0.0.1:50565.  That is, ip:port
> 
> Now, *why* that is a different port than I was listening on is beyond 
> me .
> . .

The port you use at the 'accept' point is the port to which a connection 
needs to be made by the client.

When the server accepts the connection it essentially creates a new 
socket which connects to the client at the other end. The different port 
number is the reflection of the fact that it is the server-side end of 
the client's socket.

I guess you could think of it as a 'switch-board' in a sense - accepting 
sockets are the operator, as soon as a request is received a server-side 
connection point is created and the incoming request is patched directly 
to it... It no longer goes through the operator.

Mark.

-- 
Mark Waddingham ~ mark at livecode.com ~ http://www.livecode.com/
LiveCode: Everyone can create apps




More information about the use-livecode mailing list