|
send |
Top Previous Next |
|
The send function sends data on a connected socket. Successful completion of a call to send does not guarantee delivery of the message. A return value of -1 indicates only locally-detected errors. If space is not available at the sending socket to hold the message to be transmitted, send blocks until space is available.
Syntax
Parameters socket The descriptor that identifies a connected socket.
buf A pointer to a buffer containing the data to be transmitted.
len The length, in bytes, of the data in buffer pointed to by the buf parameter. If the message is too long to pass through the underlying protocol, send fails and no data is transmitted.
flags A set of flags that specify the way in which the call is made. This parameter is constructed by using the bitwise OR operator with any of the following values.
Return value Upon successful completion, send returns the number of bytes sent. Otherwise, -1 is returned and errno set to indicate the error. |