#include <dolphin/ip.h>
s32 TCPPeek ( TCPInfo* info, void* data, s32 len );
s32 TCPPeekUrg ( TCPInfo* info, void* data, s32 len );
TCPPeek() attempts to read len bytes from the
receive buffer without removing that data from the receive buffer.
TCPPeekUrg() attempts to peek the urgent byte sent from the
other end of the connection with
TCPSendUrgAsync().
TCPPeek() and TCPPeekUrg()
do not block if there is no data in the receive buffer and return
IP_ERR_AGAIN.
Note: The current implementation assumes that the urgent pointer points to the sequence number of the last + 1 octet in a sequence of urgent data as Berkeley derived system does.
info |
Pointer to TCPInfo 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. |
| zero or greater | Succeeded. The number of retreived bytes. |
IP_ERR_AGAIN |
There is no data in the receive buffer. |
IP_ERR_CLOSING |
Connection closing. |
IP_ERR_INVALID |
info is not a valid TCPInfo. |
IP_ERR_NOT_EXIST |
Connection does not exist. |