Developer

API Reference

ISOCKET_ReadV()

Brew Release
Brew MP 1.0.2
See Also
SockIOBlock ISOCKET_Read() ISOCKET_Write() ISOCKET_WriteV()
Description
This function reads data from a socket into one or more buffers described by the entries in the iov[] array. This function always returns immediately. If there is no data available and the connection is still active, ISOCKET_ReadV() returns AEE_NET_WOULDBLOCK. To be notified when to call ISOCKET_ReadV() again, the caller must call ISOCKET_Readable().
Parameters
  • pISocket
    []:
    Pointer to the ISocket Interface object.
  • iov
    []:
    Array of SockIOBlock structures into which data can be read.
  • iovcount
    []:
    Specifies the number of entries in the iov array.
Interface
ISOCKET
Prototype
    int32 ISOCKET_ReadV
    (
    ISocket * pISocket,
    SockIOBlock iov[],
    uint16 iovcount
    )
Return
bytes_read, any positive number indicates the number of bytes that have been successfully read into the provided buffer.
0 (zero), if there is no more data to be received; the peer has shut down the connection.
AEE_NET_WOULDBLOCK, if no data available now; try again later (See ISOCKET_Readable()).
AEE_NET_ERROR, if the socket is not in a valid state to receive data.
Side Effect
None.
Comment
The specific error code can be retrieved by calling ISOCKET_GetLastError(). The error codes returned include:
AEE_NET_EBADF Invalid socket descriptor is specified.
AEE_NET_ECONNABORTED TCP connection aborted because of a time-out or other failure.
AEE_NET_ECONNRESET TCP connection reset by server.
AEE_NET_EFAULT Application buffer not valid part of address space.
AEE_NET_EIPADDRCHANGED IP address changed, causing TCP connection reset.
AEE_NET_ENETDOWN Network subsystem unavailable.
AEE_NET_ENOTCONN Socket not connected.
AEE_NET_EPIPE Broken pipe.
AEE_NET_EWOULDBLOCK Operation would block.
AEE_NET_GENERAL_FAILURE General failure.
AEE_NET_ESHUTDOWN Connection is shutdown for reading.
  • Follow