#include <dwc.h>
u32 DWC_SendReliableBitmap(u32 bitmap,
const void *buffer,
int size);bitmap |
Bitmap in which the AID bits for send destinations have been set. |
buffer |
Pointer to the send buffer. |
size |
Size of the send buffer. |
Returns an AID bitmap, with bits set for each host to which preparations to send were successful.
If the local host's own AID bit was set when the bitmap was passed to the argument, the bit remains set.
There is a failure when an error occurs, the previous send process does not end, an invalid AID is specified, or there is not enough space in the send buffer.
After matchmaking completes, this function performs a reliable send to the hosts whose AIDs are specified by bitmap.
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.
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.
By using the DWC_SendReliable function, a reliable send can be made to any specific host.
DWC_GetDirectConnectedAIDBitmap
DWC_SendReliable
For the change log prior to 5.1 PR2, click here.
CONFIDENTIAL