UDPPeek


C Specification

#include <dolphin/ip.h>

s32 UDPPeek     ( UDPInfo* info, void* data, s32 len,
                  IPSocket* local, IPSocket* remote );

Description

UDPPeek() attempts to read len bytes from the receive buffer without removing that data from the receive buffer. UDPPeek() does not block if there is no datagram in the receive buffer and returns IP_ERR_AGAIN.

Arguments

info Pointer to UDPInfo to transmit a datagram.
buffer The pointer to the receive buffer. Data cache invalidation is not necessary.
len The length of the receive buffer  in bytes.
local Optional pointer to IPSocket that receives the destination socket of the received datagram.
remote Optional pointer to IPSocket that receives the source socket of the received datagram.

Return Values

zero or greater Succeeded. The number of transferred UDP data bytes. Note it could be larger than len.
IP_ERR_AGAIN There is no datagram in the receive buffer.
IP_ERR_DATASIZE The data size (len) is less than zero.
IP_ERR_INVALID info is not a valid UDPInfo.
IP_ERR_NOT_EXIST The local socket has not been specified.

See Also

UDPCancel(), UDPClose(), UDPConnect(), UDPOpen(), IPSocket