SysSock2Accept (FUN)
FUNCTION SysSock2Accept : RTS_IEC_HANDLE
Accept the next incoming TCP connection.
This functions calls the function accept of the operating system, which can accept a request to connect
to a socket. A new descriptor (handle) for the socket is returned. The original socket is reset to the
“listening” state (see SysSockListen).
Note
For TLS Sockets the blocking mode will be set to nonblocking for the new client sockets. If a blocking behavior is needed use SysSock2Ioctl to set the socket to blocking mode. This reflects the behavior of SysSock2Create for TLS sockets.
- InOut:
Scope
Name
Type
Comment
Return
SysSock2AcceptRTS_IEC_HANDLEHandle to the new accepted socket or RTS_INVALID_HANDLE if failed.
Input
hSocketRTS_IEC_HANDLEHandle to the socket
pSockAddrPOINTER TO SOCKADDRESS
Socket address of the client, who is connected
pdiSockAddrSizePOINTER TO DINT
Pointer to size of socket address structure
pResultPOINTER TO RTS_IEC_RESULT
Pointer to runtime system error code (see CmpErrors.library)