A TCP/IP (TCP) connection is a “point to point connection”. This means that there is one sender and one receiver. This type of connection is very reliable and data sent using this connection is guaranteed to reach the receiver.
To establish a TCP connection, you must have a TCP server and a TCP client. The TCP client will always establish the connection to the TCP server and never the other way around.
For a TCP client to establish a connection to a server, it must have an IP address, the IP address of the TCP server, and the port number. Port numbers can range from 1 to 65353 and not all ports are the same. Certain ports are reserved for certain processes or applications. Therefore, always read the manual for each unit to get the port number you need.
If you want to have more than one client connected to the same TCP server, you need a TCP server that supports multiple TCP connections.
If the TCP server does not support multiple TCP connections you must make sure that the TCP clients disconnect when they are not in use. If a TCP server does not support multiple connections, then a TCP client cannot disconnect a TCP connection already established with another TCP client. Therefore, if you do not need to guarantee that the data you send reaches the receiver, or if you want a simpler way to send the same data to multiple units in the LAN, then UDP is your best option.