#include <dwc.h>
BOOL DWC_SendReliable(u8 aid,
const void *buffer,
int size);aid |
AID for the send destination. |
buffer |
Pointer to the send buffer. |
size |
Size of the send buffer. |
TRUE |
Storing the data in the send buffer succeeded. |
FALSE |
Storing the data in the send buffer failed. Either an error has occurred, the previous send process has not ended, an invalid AID was specified, or there is not enough space in the send buffer. |
After matchmaking completes, this function performs a reliable transfer to the partner specified by aid.
Although UDP is used for the reliable send, it is implemented at the library level so that data reaches the other party in the order sent without duplication or loss of packets. In return, it becomes necessary to check the arrival of packets for each send; be aware that this takes longer than an unreliable send, which does not perform this type of check.
Because data sent using this function is temporarily stored as described below, do not change the contents of the send data (buffer) during this period. To determine whether send data can be changed, use either the DWC_IsSendableReliable function to check whether reliable transfer is possible in the current state, or the send completion callback mentioned below to check whether the transfer has completed.
Data sent using this function accumulates in a send buffer, whose size is specified by the DWC_InitFriendsMatch function, until its arrival at the send destination is confirmed. If there is insufficient memory in this buffer, data not entered into the buffer is temporarily stored and sent from within the DWC_ProcessFriendsMatch function in sequential order as memory in the buffer becomes available. This function returns FALSE if this buffer is completely full.
You can send a single packet up to a fixed maximum size (DWC_TRANSPORT_SEND_RELIABLE_MAX, or 1465 bytes, by default). Data that is larger than this maximum value will be split up internally when it is sent. The split-up data is saved temporarily and then sent sequentially in the DWC_ProcessFriendsMatch function.
The maximum data size can be changed using the DWC_SetSendSplitMax function. To maintain compatibility with communication devices configured in various ways, do not set this size larger than the default.
When a send completion callback has been configured with the DWC_SetUserSendCallback function, the callback is called when the sending of data has finished. However, the concept of "send complete" being used here indicates that data has been stored in the send buffer, not that data has arrived at the other host.
Reliable sends can be carried out only with directly connected hosts. As a result, in a star connection topology, only the server host can use reliable sends. With a hybrid connection, reliable sends are possible only with AIDs obtained using the DWC_GetDirectConnectedAIDBitmap function. Reliable sends are possible to all connected hosts when using a full mesh connection.
DWC_GetDirectConnectedAIDBitmap
DWC_SendReliableBitmap
For the change log prior to 5.1 PR2, click here.
CONFIDENTIAL