TcpClient (FB)

FUNCTION_BLOCK TcpClient EXTENDS TcpConnection IMPLEMENTS ITcpClient

TCP client to establish a connection to a TCP server.
Once a connection has been established with the method TcpClient.Connect, data can be send or received via the corresponding methods TcpConnection.Send & TcpConnection.Receive.
The TcpConnection.Peek method can be used to read data without removing them from the TCP buffer.
With TcpConnection.Close the communication will be closed accordingly.

Hint

Communication can be done either via Standard Sockets (STD) or via TLS Sockets (TLS 1.2).

Properties:

ConnectionState, inherited from TcpConnection

IpAddress, inherited from TcpConnection

Socket, inherited from TcpConnection

Methods:

Connect

Close, inherited from TcpConnection

Peek, inherited from TcpConnection

Receive, inherited from TcpConnection

Send, inherited from TcpConnection

SetIntSocketAddr, inherited from TcpConnection

Structure: