![]() |
|
| << Previous | Index | Next >> | |
| | |
int sock_awrite( tcp_Socket *s, byte *dp, int len );
Description
Write exactly
lenbytes to the socket or, if that amount of data can not be written, do not write anything. Unlikesock_fastwrite(), this function will never return less than the requested amount of data. This can be useful when the application needs to write a fixed amount of data, but does not wish to handle the transmission of only part of the data, as it would have to do ifsock_fastwrite()was used.
lenmust be less than or equal to the socket transmit buffer size, otherwisesock_fastwrite()must be used.This function is only valid for TCP sockets. It is available starting with DC 7.30.
s
- Pointer to a TCP socket.
dp
- Buffer containing data to write.
len
- Number of bytes to write to the socket buffer.
Return Value
-1:lenis greater than the total socket receive buffer size, hence this request could never be satisfied in one call.
-2: The socket has been closed for further transmissions, e.g., becausesock_close()has already been called.
-3:len< 0 or the socket parameter was invalid.
0: Insufficient free space in the transmit buffer to satisfy the request, orlenwas zero. Try again later since the peer will eventually acknowledge the receipt of previous data, freeing up transmit buffer space.
len: Thelenparameter is returned if there was sufficient data in the socket transmit buffer to satisfy the request.Library
TCP.LIB
See Also
| TCP/IP Manual Vol 1 |
<<Previous | Index | Next>> | rabbit.com |