The listening port when the serial port server is in
TCP Server or UDP mode. As a client, it is best to
specify the port as port 0, which helps to increase
the connection speed. When port 0 is used, the
system will randomly allocate a local port. The
difference between this and non-zero port is: (1)
When the local port is 0, a new TCP connection
will be established with the PC when the module
restarts, the old TCP connection may not be
closed, and the device may have multiple fakes.
connect. Generally, the host computer hopes to
close the old connection when the module
restarts; specifying a non-zero port will close the
old connection. (2) When the local port is 0, the
time for TCP to re-establish the connection is
faster. When the serial port server is in TCP client
mode, it also acts as a TCP server to monitor
connections on the port. At the same time, the
local port number used by the TCP client to
connect to the server is "port+1" .
When set to TCP server, the serial port server
waits for the computer to connect; when set to
TCP client, the serial port server actively initiates a
connection to the network server specified by the
destination IP.