The WRITE.SOCKET() function writes data to a socket.
WRITE.SOCKET(skt, data, flags, timeout)
If neither blocking flag is given, the blocking mode set when the socket was opened is used.
The WRITE.SOCKET() function writes the given data and returns the number of bytes written. If non-blocking mode is used or a timeout occurs, this byte count may be less than the length of the data. The remaining data can be written with a subsequent call to WRITE.SOCKET() when buffer space becomes available.
The STATUS() function returns zero if the action is successful, or a non-zero error code if an error occurs. A timeout will return an error code of ER$TIMEOUT as defined in the SYSCOM ERR.H record.
SKT = OPEN.SOCKET("184.108.40.206", 3000, SKT$BLOCKING)
IF STATUS() THEN STOP 'Cannot open socket'
N = WRITE.SOCKET(SKT, DATA, 0, 0)
This program fragment opens a connection to port 3000 of IP address 220.127.116.11, sends the data in DATA and then closes the socket.