![]() |
|
| << Previous | Index | Next >> | |
| | |
int sock_write( tcp_Socket *s, byte *dp, int len );
Description
Writes up to
lenbytes fromdpto sockets. This function busy waits until either the buffer is completely written or a socket error occurs. Ifsock_yield()has been called, the user-defined function that is passed to it will be called in a tight loop whilesock_write()is busywaiting.For UDP,
sock_write()will send one (or more) records. For TCP, the new data may be transmitted if enough data is in the buffer or sufficient time has expired or the user has explicitly usedsock_flushnext()to indicate this data should be flushed immediately. In either case, there is no guarantee of acceptance at the other end.Starting with Dynamic C 7.05, this function is only valid for TCP sockets. For UDP sockets, use
udp_send()orudp_sendto().Parameters
s
- Pointer to a socket.
dp
- Pointer to a buffer.
len
- Maximum number of bytes to write to the buffer.
Return value
- Number of bytes written or
-1on an error.Library
TCP.LIB (Prior to DC 7.05, this was DCRTCP.LIB)
See also
| TCP/IP Manual Vol 1 |
<<Previous | Index | Next>> | rabbit.com |