Raritan Computer SX8 用户手册

下载
页码 172
A
PPENDIX 
H:
 
TCL
 
P
ROGRAMMING 
G
UIDE 
 147 
 
 
ampopensocket [ip_address port_number] 
Opens a socket to a specific port on a device with a given IP address. The command returns a unique socket 
ID. If the command fails or the arguments are improperly formatted, the command will return an error 
message. The IP address must be specified in “dot notation.”  (i.e., 207.25.71.20) 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
ampwritesocket [socket_id message] 
Sends a string to the socket represented by the socket ID.  If the write fails or the arguments are invalid, the 
command will return an error with an error message. 
 
Command Return 
Messages 
0 (TCL_OK) 
No message returned 
(TCL_ERROR) 
wrong # args: should be ampwritesocket 
socketDescriptor message. Command failed 
Invalid Socket Descriptor %s 
write socket failed 
 
 
ampclosesocket [socket_id] 
Closes the socket represented by the socket ID. If the command fails or the arguments are invalid, the 
command will return an error with an error message. 
 
Command Return 
Messages 
0 (TCL_OK) 
No message returned 
(TCL_ERROR) 
wrong # args: should be ampclosesocket 
socketDescriptor 
Invalid Socket Descriptor %s 
close socket failed 
 
 
Command Return 
Messages 
0 (TCL_OK) 
Unique socket ID returned 
(TCL_ERROR) 
wrong # args: should be ampopensocket 
ipAddress port 
invalid IP address %s 
Invalid Port Number %s, values allowed 
between [0-65535] 
Invalid Port Number %s, only 16 bits digit 
allowed 
open socket failed