SysSockGetSockName (FUN)ΒΆ

FUNCTION SysSockGetSockName : RTS_IEC_RESULT

Returns the socket address of the local socket.
Usally this function is called to retrieve the local socket address on multihomed hosts or to get the local port number in client implemntations. If the socket is neither connected nor locally bound to an address, the result of the function and the value stored in the object pointed to by pSockAddress is unspecified.
InOut:

Scope

Name

Type

Comment

Return

SysSockGetSockName

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 local socket

pdiSockAddrSize

POINTER TO DINT

Pointer to size of socket address structure