Zen API

- Home
- Topics
- Types
- Files

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

  socket | Socket object.
  endPoint | Receives the destination address of the datagram.
  adapterId | Receives the unique numeric identifier associated with the local network adapter on which the datagram was received (or kSIZE_NULL, if unknown).
  buffer | Buffer to receive the datagram.
  size | The maximum number of bytes to return.
  read | The number of bytes that were read.

Returns
  Operation status.

See also
  kNetworkInfo_FindAdapterById, kNetworkAdapter_Id