SysSockAccept

This function of type DINT calls the function accept of the operating system, which can accept a connection request to the socket. A new descriptor (handle) for the socket is returned. The orignal socket will be reset to the “listening” status (see SysSockListen).

Variable Data type Description
diSocket DINT

A descriptor identifying a socket that has been placed in a listening state with the listen function. The connection will actually be made with the socket that is returned by the SysSockListen function. The requested connection then will be made with that socket, for which the SysSockAccept function returned a handle.

(corresponding parameter, e.g. in Win32:s)

pSockAddr DWORD

Pointer on a variable of type SOCKADDR; will be filled with the address of the caller.

(corresponding parameter, e.g. in Win32: addr)

piSocketAddrSize DWORD

Pointer to a variable of type DINT. This variable has got assigned the length of the structure SockAddr (can be retrieved with the aid of the SIZEOF operator)

(corresponding parameter, e.g. in Win32: addrlen)

Structure SOCKADDR:

sin_family : INT;  (* Adress-family, defines address format *)

sin_port : UINT;  (* Port of the connection requesting unit *)

sin_addr : UDINT;  (* IP-address of the requesting unit *)

sin_zero : ARRAY [0..7] OF SINT;  (* buffer *)