5 accept% function – Rockwell Automation 57C610 Enhanced Basic Language, AutoMax User Manual
Page 114

8Ć4
Values Returned:
ă1
Success
-2
ENI not initialized
-9
No buffer space
-12 Bad InterNet address
-15 Bad socket number
-102 Socket not connected
For example:
STATUS% = CONNECT%( SN%, DEST_INET_ADDR$, 5001 )
8.5
ACCEPT% Function
Format:
ACCEPT%( sn%, nsn% )
where:
sn%
is the number of the TCP socket that should begin
waiting for a connection to be made. This can be
specified as a simple variable or as an element of
an array.
nsn%
is filled in by this function with a new socket
number created when a connection has been
established. This must be a simple variable; array
elements are not allowed.
This function is used to direct the ENI to do a passive open. This is
valid only on TCP sockets. This function suspends execution of the
task and waits until a connection is established. When a connection
arrives, it creates a new socket with the attributes of the given
socket to service the connection. The application program may then
shut down the original socket sn%, or it may loop back to the
ACCEPT% to wait for another connection to come in. In this way a
given service may have more than one client at a time.
Communication will take place through the new socket.
Values Returned:
ă1
Success
-2
ENI not initialized
-7
Did not accept
-9
No buffer space
-15 Bad socket type
-16 Not a TCP socket
For example:
STATUS% = ACCEPT%( SN%, NSN% )