Zen API
 All Classes Files Functions Variables Typedefs Friends Macros Modules Pages
kStatus kSocket_ReadFromEx ( kSocket  socket,
kIpEndPoint endPoint,
kSize adapterId,
void *  buffer,
kSize  size,
kSize read 
)

Reads a datagram and associated metadata.

In blocking mode, this function will block until a datagram is read (or a read timeout occurs).

In non-blocking mode, kSocket_Wait should be used to determine when this function can be called successfully.

The kNetworkInfo_FindAdapterById method can be used to translate the unique numeric adapter identifier provided by this method to a network adapter name.

Parameters
socketSocket object.
endPointReceives the destination address of the datagram.
adapterIdReceives the unique numeric identifier associated with the local network adapter on which the datagram was received (or kSIZE_NULL, if unknown).
bufferBuffer to receive the datagram.
sizeThe maximum number of bytes to return.
readThe number of bytes that were read.
Returns
Operation status.
See also
kNetworkInfo_FindAdapterById, kNetworkAdapter_Id