Send
Purpose
Use the Send function to send data on a connected socket.
By specifying option flags, you can also:
- Send out-of-band data
- Suppress the use of local routing tables
If Send cannot send the number of bytes of data that is requested, it waits until sending is possible. This blocks the caller, unless the socket is in nonblocking mode. For datagram sockets, the socket should not be in blocking mode.
Parameters
- socketid
- is the identifier of the socket.
- data
- is the message string to be sent.
- sendflags
- are flags that control the Send operation:
- MSG_OOB or OOB or OUT_OF_BAND
- Sends out-of-band data on the socket. Only AF_INET stream sockets support out-of-band data.
- MSG_DONTROUTE or DONTROUTE
- Do not route the data. Routing is handled by the calling program. This flag is valid only for datagram sockets.
- ''
- Send the data. No flag is set. This is the default.
Return Values
If successful, this function returns a string containing return code 0 and the length of the data sent. If unsuccessful, this function returns a string containing a nonzero return code, an error name, and an error message.
Examples
- Call
- Return Values
Socket('Send',6,'Some text')'0 9'Socket('Send',6,'Out-of-band data','OOB')'0 16'
The C socket call is: send(s, buf, len, flags)
Messages and Return Codes
For a list of REXX Sockets system messages, see REXX Sockets System Messages. For a list of REXX Sockets return codes, see REXX Sockets Return Codes.
