
Chapter 2 – Command Line Interface (CLI)
Command Line Interface and Application Examples for Multi-Tech Systems, Inc. IP Modules (S000368F) 61
RAW TCP/UDP Socket Support Setup
Commands
Command Syntax socket tcp <remote-ip> <remote-port>
Description
Opens a TCP client socket and attempts to connect it to the specified remote port on
a specified remote server. The remote server should be set with a DNS resolvable
name or IP address.
Upon successful connection, a socket handle is returned for future socket
transactions.
Default Value
-
Success
<socket handle > OK
Error 1. Too few arguments
Type socket tcp ? for more information
2. Connection refused
connect: Connection refused
Command Syntax socket tcplisten <local-port> [backlog]
Description
Opens a TCP Listen socket on the local port.
The backlog specifies the maximum number of remote connections allowed through
the listen socket at any given time.
The listen socket automatically accepts remote connection requests (<=backlog)
and spawns a new TCP socket which can send or receive data. The tcplisten
command, upon success, returns a server socket handle.
The listen sockets are created when a remote host tries to connect and the
connections are accepted.
Default Value
-
Success
TCP Listen socket handle <server socket handle>
OK
Error 1. Too few arguments
Type socket tcplisten ? for more information
2. Address already in use
bind: Address already in use.
Command Syntax socket udp <remote_ip> <remote_port> [local_port]
Description
If the host is given as 0.0.0.0, it opens a non-connected UDP listen socket and
automatically latches to the IP address of the first UDP packet received.
If the remote-port is set to 0, it opens a non-connected UDP listen socket and
automatically latches to the port of the first UDP packet received.
If the remote-host and remote-port are nonzero values, the IP Module acts as a
UDP client sending/receiving data to the specified host and port.
If the optional local-port is mentioned, the socket is bound to this port instead of
taking the port from internal pool.
Returns the corresponding socket handle for future socket transactions.
Default Value
-
Success
<socket handle> OK
Error 1. Too few arguments
Type socket udp ? for more information
2. Address already in use
bind: Address already in use.
Kommentare zu diesen Handbüchern