Senatek HELLODEVICE LITE SERIES LS100 Manuale Utente

Pagina di 46
 
31
4.1.2 TCP Server Mode Configuration 
 
To configure the LS100 to work as a TCP server, use ‘set’ command as follows: 
 
set host tcps listening_TCP_port inactivity_timeout + <CR> 
where, 
 
listening_TCP_port: Listening TCP port 
Inactivity_timeout: Inactivity timeout in seconds. 
 
Listening TCP port is the TCP port number through which remote host can connect a TCP session, 
and, send and receive data. Incoming connection request to the ports other than  Listening TCP Port 
will be rejected. The LS100 does not restrict the number to a specific range, but it is strongly 
recommended not to use the well-known ports for certain application (See Appendix D.  Well-known 
Port Numbers). To change the port number,  select menu 2  on  the  TCP Server mode configuration 
screen. 
Inactivity timeout is set to maintain the TCP connection state as Closed or Listen in TCP host mode 
unless there is any data transfer between the serial device and the LS100. If there is no incoming or 
outgoing data through the serial port during the specified  inactivity timeout interval, the existing TCP 
connection will be closed automatically. 
If the value of inactivity timeout is set to 0, the current TCP connection is maintained unless there’s no 
connection close request. Although inactivity timeout is disabled, the LS100 will check the connection 
status between the LS100 and the remote host by sending  “keep alive” packets periodically. If the 
remote host does not answer the packets, it is regarded  that the connection is down unintentionally. 
Then, the LS100 will force to close the existing TCP connection. 
Note: 
At least, this value should be set larger than that of inter-character timeout. To prevent the unintended 
loss of data due to the  session disconnection, it is highly recommended that this value is set large 
enough so that the intended data transfer is completed. 
 
Figure 4-2 shows TCP server mode setting example: 
 
> set host tcps 6001 300 
OK 
Figure 4-2. TCP server mode setting