SysSock2Create
(FUN)
FUNCTION SysSock2Create : RTS_IEC_HANDLE
Create a new socket and return the socket handle. By now STD or TLS sockets are available. Using a STD socket results in the default socket behavior.
Note
Using the TLS socket results in an IPv4 TCP socket where the TLS protocol is used. Since additional handshaking has to be done, connection establishment takes some time longer. By default, these sockets are created as nonblocking. If a blocking behavior is needed this has to be set explicitly. Be aware that blocking TLS sockets can lead to deadlock situations if the peer does not send TLS data. This is a potential security risk, typically for server implementations. An attacker can create a connection and then stop sending TLS data, resulting in a denial of service attack. This situation is avoided with nonblocking sockets.
To avoid this potential risk by default TLS based sockets are created as nonblocking by default. This applies to handles created by SysSock2Create and SysSock2Accept. If this has to be changed use the SysSock2Ioctl to setup the desired behavior.
- InOut:
Scope
Name
Type
Comment
Return
SysSock2Create
RTS_IEC_HANDLE
A handle to the created socket or INVALID_HANDLE if something went wrong. The return is a descriptor (handle) of the new socket, which is required as input parameter by other library functions like SysSock2Bind, SysSock2Connect etc.
Input
pParameter
POINTER TO SysSocket2_Parameter
Class specific parameters. See SysSock_Parameter for details
pResult
POINTER TO RTS_IEC_RESULT
Pointer to runtime system error code (see CmpErrors.library)