Developer

API Reference

ISOCKET_WriteV()

Brew Release
Brew MP 1.0.2
See Also
None.
Description
This function writes data to a connected socket. It gathers data from one or more buffers described by the entries in the iov[ ] array into a single write operation. Behavior can differ from separate calls to ISOCKET_Write() in that multiple calls to ISOCKET_Write() can generate unnecessary multiple TCP packets.
This function always returns immediately with the number of bytes that were successfully written. If no bytes can be successfully written and the connection is still active, ISOCKET_WriteV() returns AEE_NET_WOULDBLOCK. To be notified when to call ISOCKET_WriteV() again, the caller must call ISOCKET_Writeable().
Parameters
  • pISocket
    []:
    Pointer to the ISocket Interface object. iov[ ] : An array of SockIOBlocks containing the individual buffers to be sent.
  • wiovcount
    []:
    Number of entries inside the SockIOBlock structure.
Interface
ISOCKET
Prototype
    int32 ISOCKET_WriteV
    (
    ISocket * pISocket,
    SockIOBlock iov[],
    uint16 wiovcount
    )
Return
bytes_written: ( > 0), Any positive number indicates the total number of bytes successfully written from all of the iov[] buffers.
AEE_NET_WOULDBLOCK: No bytes can be written at this time; try again later (See ISOCKET_Writeable().
AEE_NET_ERROR, Failed to write any bytes.
Side Effect
None.
Comment
The Network specific error code can be retrieved by calling ISOCKET_GetLastError(). One of the following error codes is returned:
AEE_NET_EBADF Invalid socket descriptor is specified.
AEE_NET_ENOTCONN Socket not connected.
AEE_NET_ECONNRESET TCP connection reset by server.
AEE_NET_ECONNABORTED TCP connection aborted because of a time-out or other failure.
AEE_NET_EIPADDRCHANGED IP address changed, causing TCP connection reset.
AEE_NET_EPIPE Broken pipe.
AEE_NET_ENETDOWN Network subsystem unavailable.
AEE_NET_EFAULT Application buffer not valid part of address space.
AEE_NET_GENERAL_FAILURE General failure.
AEE_NET_ESHUTDOWN Connection is shutdown for writing
  • Follow