The Accept Connections command is not completely documented and it appears that the parameters to Read From Socket differ slightly depending on whether you opened the socket with Open Socket or Accept Connections.

First, it is documented under Accept that when you use the command:
accept connections on port number with message msgname
then either one or two parameters are passed to handler msgname. The first is the host IP address and the optional second a datagram.

In my testing, there were always two parameters. The first is the hostIP | connectionID and the second the port, on initial connection, and a datagram on Reads.

Further, to read data from the socket once a connection is made you specify the host in:
read from socket socketID with msgname
as hostIP | connectionID, as returned from the initial connection, whereas reading after Open Socket uses hostIP : Port as the socket specifier.

I have not tested the alternatives exhaustively and may have found optional ways of doing things rather than complete differences, but I would like clarification in the documentation please.

Minor editorial: the Accept Connections help refers to messagename and messagestring, apparently meaning the same thing. Read does similarly with msgname and messagestring.

regards
David

Reply via email to