
Chapter 2 – Command Line Interface (CLI)
Command Line Interface and Application Examples for Multi-Tech Systems, Inc. IP Modules (S000368F) 63
RAW TCP/UDP Socket Support – Setup Commands
Command Syntax socket recv [-s <max_size>] <socket_handle>
Description
Retrieves the exact size of data received followed by data stream from the specified
socket handle (corresponds to TCP or UDP socket). The data is valid only if it's
already in the socket's input buffer.
If the max-size is not specified, all the data in the input buffer is retrieved. If the max-
size is specified, only the specified size is retrieved and the rest is left out in the
buffer. If the socket buffer is empty, "0" is returned.
Default Value
-
Success
<data> <bytes read> OK.
Error 1. Invalid socket handle
2. Too few arguments
Type socket recv ? for more information
3. Socket handle not specified
Type socket recv ? for more information
Command Syntax socket stat [-s] [-d] <socket_handle>
Description
When the socket-only option is specified, it displays the number of bytes present in
the corresponding TCP/UDP socket's input buffer. When the socket-detail option is
specified, it lists all the connect details like Local IP address, Local Port, Remote IP
address, Remote Port etc. Note: Socket detail is considered the default.
Default Value
-
Success
OK.
Error 1. Too few arguments
Type ‘socket stat ?’ for more information
2. Invalid socket handle
Command Syntax socket flush <socket handle>
Description
Flushes all the buffered data currently accumulated in the corresponding TCP/UDP
socket's input buffer. The socket remains open.
Default Value
-
Success
OK.
Error 1. Invalid Socket Handle
Type socket flush ? for more information
2. Argument required
Type socket flush ? for more information
Command Syntax socket flushall
Description
Flushes all the buffered data currently accumulated in the active TCP/UDP socket’s
entire input buffer. The socket remains open.
Default Value
-
Success
OK
Error 1. Invalid Argument
Error: type ‘socket flushall ?’ for more information
Command Syntax socket close <socket handle>
Description
Closes the corresponding TCP/UDP socket after flushing off its buffers.
Default Value
-
Success
OK
Error 1. Argument required: Error: type ‘socket close ? ‘ for more information
2. Invalid socket handle
Command Syntax socket closeall
Description
Closes all the active TCP/UDP sockets after flushing off their buffers.
Default Value
-
Success
All sockets closed
OK
Error 1. Invalid Argument: Error: type ‘socket closeall ?’ for more information
Comentarios a estos manuales