VgaGames 3 - Network man-pages

[.. upper level ..]

VG3_nw_fetch_data()

[added in version 1.2]

Return a new received data-packet.
SYNTAX
int VG3_nw_fetch_data(struct vg3_nwclient *nwclnt, char *data, size_t dsize)

FUNCTION PARAMETERS
nwclnt Network-struct
data For returning the data-packet
dsize Size of data

RETURN VALUE
Returns 0 or the sender-client-number, see description below.

DESCRIPTION
Return a received data-packet. A data-packet sent with VG3_nw_send_data() by a client will be received by all other clients via VG3_nw_update() or via VG3_nw_recv_data(). VG3_nw_fetch_data() just retrieves this data-packet to the application. If there is a not yet recalled data-packet, this function retrieves it, and the return value will be the corresponding sender-client-number. If there is no new data-packet, nothing will be retrieved and the return value will be 0. It is possible to pass the parameters data set to NULL and dsize set to 0. Then no data will be returned, but just checked if new data are available.

SEE ALSO
VG3_nw_send_data() VG3_nw_recv_data()