SysSockBind (FUN) ¶ FUNCTION SysSockBind : RTS_IEC_RESULT Bind a socket to a socket address and port number. This functions calls the function bind of the operating system, which will assign a local address to a socket that has already been allocated to an address by SysSockCreate , but not yet fixed uniquely. This is usually done previous to a call to functions like SysSockListen or SysSockAccept . InOut: Scope Name Type Comment Return SysSockBind RTS_IEC_RESULT Runtime system error code (see CmpErrors.library). Input hSocket RTS_IEC_HANDLE Handle to the socket pSockAddr POINTER TO SOCKADDRESS Spcket address diSockAddrSize DINT Size of the socket address structure
SysSockClose (FUN) ¶ FUNCTION SysSockClose : RTS_IEC_RESULT Close a socket. InOut: Scope Name Type Comment Return SysSockClose RTS_IEC_RESULT Runtime system error code (see CmpErrors.library). Input hSocket RTS_IEC_HANDLE Handle to the socket
SysSockCloseUdp (FUN) ¶ FUNCTION SysSockCloseUdp : RTS_IEC_RESULT Close a UDP socket. Handle must be retrieved by SysSockCreateUdp ! This function calls the function closesocket of the operating system to close a socket working with the user datagram protocol UDP. InOut: Scope Name Type Comment Return SysSockCloseUdp RTS_IEC_RESULT Runtime system error code (see CmpErrors.library). Input hSocketUdp RTS_IEC_HANDLE Handle to the UDP socket. Must be opened with SysSockCreateUdp !
SysSockConnect (FUN) ¶ FUNCTION SysSockConnect : RTS_IEC_RESULT Connect as a client to a TCP server. InOut: Scope Name Type Comment Return SysSockConnect RTS_IEC_RESULT Runtime system error code (see CmpErrors.library). Input hSocket RTS_IEC_HANDLE Handle to the socket pSockAddr POINTER TO SOCKADDRESS Socket address of the server to connect to diSockAddrSize DINT Size of socket address structure
SysSockCreate (FUN) ¶ FUNCTION SysSockCreate : RTS_IEC_HANDLE Create a new socket and return the socket handle. InOut: Scope Name Type Comment Return SysSockCreate RTS_IEC_HANDLE Handle to the new socket. The return is a descriptor (handle) of the new socket, which is required as input parameter by other library functions like SysSockBind , SysSockConnect etc. Input iAddressFamily INT Socket address family diType DINT Socket type diProtocol DINT Socket protocol pResult POINTER TO RTS_IEC_RESULT Pointer to runtime system error code (see CmpErrors.library)
SysSockCreateUdp (FUN) ¶ FUNCTION SysSockCreateUdp : RTS_IEC_HANDLE Higher level function, to create a complete UDP socket. The socket will make use of the user data protocol UDP. InOut: Scope Name Type Comment Return SysSockCreateUdp RTS_IEC_HANDLE Handle to the UDP socket Input diSendPort DINT Port number to send (host byte order) diRecvPort DINT Port number to receive (host byte order) pResult POINTER TO RTS_IEC_RESULT Pointer to runtime system error code (see CmpErrors.library)
SysSockFdInit (FUN) ¶ FUNCTION SysSockFdInit : RTS_IEC_RESULT Add a socket to a socket set. InOut: Scope Name Type Comment Return SysSockFdInit RTS_IEC_RESULT Runtime system error code (see CmpErrors.library). Input hSocket RTS_IEC_HANDLE Socket to add pfs REFERENCE TO SOCKET_FD_SET Socket Set
SysSockFdIsset (FUN) ¶ FUNCTION SysSockFdIsset : BOOL Check if a socket is inside of a set. InOut: Scope Name Type Comment Return SysSockFdIsset BOOL TRUE if it is inside the set, FALSE if not. Input hSocket RTS_IEC_HANDLE Socket to check pfs REFERENCE TO SOCKET_FD_SET Socket Set
SysSockFdZero (FUN) ¶ FUNCTION SysSockFdZero : RTS_IEC_RESULT Clear a Socket set. InOut: Scope Name Type Comment Return SysSockFdZero RTS_IEC_RESULT Returns the runtime system error code (see CmpErrors.library). Input pfs REFERENCE TO SOCKET_FD_SET Socket Set
SysSockGetFirstAdapterInfo (FUN) ¶ FUNCTION SysSockGetFirstAdapterInfo : RTS_IEC_HANDLE Get adapter information struct of the first network adapter. Note: It may took a while until a change of the adapter configuration is reflected here. InOut: Scope Name Type Comment Return SysSockGetFirstAdapterInfo RTS_IEC_HANDLE Handle to be passed to SysSockGetNextAdapter() to retrieve the next adapter information. Input pAdapterInfo POINTER TO SOCK_ADAPTER_INFORMATION Network adapter information structure puxiAdapterInfoSize POINTER TO __UXINT Size in bytes of |SOCK_ADAPTER_INFORMATION| ; returns structure size from external implementation pResult POINTER TO RTS_IEC_RESULT Pointer to runtime system error code (see CmpErrors.library)