TcpConnection.SetIntSocketAddr (METH)

METHOD SetIntSocketAddr : BOOL

Method to explicity set internal socket address
If SockAddrSetByExternal is ZERO, then we assume that the method is called internally and the internal parameter are set for the server side.
Elsewise, if SockAddrSetByExternal is unequeal to ZERO, the listen server received an incoming connection with information about the socket address and therefore an EXTERNAL socket address must be set for the internal Tcp connection of the PLC.
This internal Tcp connection of the PLC holds all information of the connection and can be used to Send, Receive or Close the communication.

Hint

The socket address is either defined internally to open a socket to connect to a Tcp server (Client mode) or is set externally when the PLC is opened as a listening server. Anyway the TcpConnection requires the socket address to communicate via this socket.

InOut:

Scope

Name

Type

Initial

Comment

Return

SetIntSocketAddr

BOOL

Input

SockAddrSetByExternal

POINTER TO SysSocket2.SOCKADDRESS

0

Socket address received from TCP server accept method. NOT required when used in _SetIntSockParam