User`s guide
KwikNet TCP/IP Sockets
K
A
DAK
223
kn_writev kn_writev
Purpose Send Scattered Data to a Socket
Used by
n Task o ISP o Timer Procedure o Restart Procedure o Exit Procedure
Setup Prototype is in file KN_SOCK.H.
#include "KN_SOCK.H"
int kn_writev(int s, struct iovec *iovecp, int iovcnt);
Description S is a socket descriptor identifying the socket to which data is to be sent.
The socket must be connected.
Iovecp is a pointer to an array of data vectors describing the locations of
the data to be sent. Each data vector is an iovec structure which is
described in file KN_SOCK.H as follows:
struct iovec {
void *iov_base; /* Data pointer */
int iov_len; /* Length of data */
};
Iov_base
is a pointer to data to be sent.
Iov_len is the data buffer size, measured in bytes.
Iovcnt is an integer defining the number of data vectors (iovec
structures) which are provided in the array referenced by parameter
iovecp.
Returns If successful, the total number of bytes of data sent is returned.
The array of iovec structures at *iovecp is unaltered.
Upon successful return, you must examine the data vectors to determine if
the total number of bytes in the array of vectors matches the number just
sent. If not, you must identify the
iovec structure at which the current
operation ceased. You must then adjust the data pointer and length of that
vector to bypass the fraction of the data which has been sent. You can
then make another request to send the remainder, starting at the corrected
position in that vector.
On failure, the error status -1 is returned.
...more