
Chapter 15 – Raw TCP/UDP Socket Interface to the Serial Device
Command Line Interface and Application Examples for Multi-Tech Systems, Inc. IP Modules (S000368F) 145
Chapter 15 – Raw TCP/UDP Socket
Interface to the Serial Device
Introduction
The serial/host device can use the IP Module Raw TCP or UDP socket interface to work with multiple servers with
proprietary protocols between the device and the remote servers.
Features
• Opens RAW TCP sockets and establishes TCP sessions to any TCP server running on any port.
• Opens, connect s, and binds UDP sockets.
• Opens a TCP listen socket on any configured port.
• Maintains the socket status and sessions and list the socket status upon request from the device.
• Closes the specified socket or all the sockets, which was/were opened previously.
• Transmits or receives data of a specified size on any previously opened socket.
• Flushes data in the socket buffer of any previously opened socket at any time.
• Supports multiple TCP sockets, UDP sockets, TCP listen sockets respectively.
Important Notes
• This application is applicable only in the IP module in non-transparent mode.
• This application can be used only after the PPP link is UP with an IP Address on the modem port. (Refer
to the Prerequisites chapter - Physical Link Establishment for more details)
• In the event of PPP link DOWN, the RAW Socket request triggers PPP link establishment.
Only these commands trigger the PPP link, if link is DOWN:
socket tcp <remote-ip> <remote-port>
socket udp <remote-ip> <remote-port> <local-port>
Commands to Access the RAW TCP and UDP Socket Interface
The host/serial device can use the following commands to work on the sockets to send/ receive data to/from a remote
server depending on the requirements.
Syntax
socket close <socket-handle>
socket closeall
socket flush <socket-handle>
socket flushall
socket listall [-s] [-d]
socket listlisten [-s] [-d]
socket recv [-s <max-size>] <socket-handle>
socket send <[-s <max-size>] [-d <delim>]> [-m <MTU>] <socket-handle>
socket stat [-s] [-d]
socket tcp <remote-ip> <remote-port>
socket tcplisten <local-port> [backlog]
socket udp <remote-ip> <remote-port> <local-port>
Kommentare zu diesen Handbüchern