UDPOpen


C Specification

#include <dolphin/ip.h>

s32 UDPOpen ( UDPInfo* info, void* heap, s32 heapLen );

Description

UDPOpen() creates an endpoint for UDP communication. Connection to the other end is created with a UDPConnect() call. Once connected, data may be transferred using UDPSendAsync() and UDPReceiveAsync(). When a session has been completed, UDPClose() should be performed.

When a UDP datagram arrives and if the application program has not called UDPReceiveAsync(), the datagram will be saved in the default receive buffer specified with [heap, heap + heapLen). If the datagram is too big to save in the default receive buffer, the datagram is simply discarded.

Arguments

info Pointer to UDPInfo to initialize.
heap The pointer to the default receive buffer.
heapLen The size of the heap in bytes.

Return Values

IP_ERR_NONE Succeeded.
IP_ERR_EXIST Specified info is already in use.
IP_ERR_INVALID info is NULL.

See Also

UDPConnect(), UDPClose(), UDPSendAsync(), UDPReceiveAsync()