CTR Pia
4.11.3
Game Communication Engine
|
This sample demonstrates the use of the nn::pia::transport
module's ReliableBroadcastProtocol
class.
This sample demonstrates the following.
Select the communication mode from this screen. Select to perform matchmaking, and then go to the Main screen.
Input | Operation |
---|---|
A Button | Run local communication (UDS library) as a host. After you successfully create a session, you transition to the Main screen. |
B Button | Run local communication (UDS) as a client. Search the UDS network and join what you find, and then transition to the Main screen. If you press START during a search of the UDS network, you cancel the search and return to the Mode Selection screen. |
X Button | Run in the mode that uses Internet communication. Perform random matchmaking. If there is a session that can be joined, join it as a client. If there are no sessions, create one as the host. Then you transition to the Main screen. |
START | Exits the program. |
Send data using the ReliableBroadcastProtocol
class. While on the Main screen, other devices can join or leave the session at any time. When a session cannot continue because of an error or another reason, you are automatically returned to the Mode Selection screen.
In State, the current operating status (State
) is displayed.
In Receive, specify the receive request to receive and the size of the receive buffer, and then start receiving. In request, switch the receive request. If you select an existing receive request, that information is displayed. top priority is a top priority receive request. You normally select this option. receive buffer size specifies the size of the receive buffer. The receive operation fails if this buffer size is smaller than the data size of the receive request. Start receiving with Start receive. If you select the receiving station directly in request, you can start receiving even if there is no receive request. Receiving starts as soon as a receive request is delivered. Receives for the receive request that is selected in Reject request are rejected.
In Send, specify the size to send and the send settings, then start the send. In data size, specify the size of data to send. The method of operation for sends is set in the settings from send to newcomer through mediate request. For more information, see ReliableBroadcastProtocol::Configuration
. Start the send with Start send. The data that is sent is random parts of the preset 10 MB of data. The part that is sent is randomly selected in each send, and that position is displayed as offset. When the data is sent, the offset value is specified as user data (see ReliableBroadcastProtocol::StartSend
), and the receiver is notified. After receiving the data, the receiver uses this value to verify the contents.
In Progress, the progress of current send and receive operations is displayed. Suspend send and receive operations that are currently in progress by using Cancel. If you send with send endless set to yes, end the send by using Finish send endless. For more information, see ReliableBroadcastProtocol::Configuration::IsSendEndless
. Send and receive results are retained after the send and receive operation ends, and you can view them. Use Reset to reset results to the default values. You can start the next send and receive operation without performing a reset.
Input | Operation |
---|---|
Up/down on the +Control Pad | Moves the cursor (and turns it pink). |
Left/right on the +Control Pad | If the cursor is on a value that can be switched, change the value. When changing the number of bytes for an item, the number normally changes in increments of 256 KB. However, if you hold down the L Button, you can change the number in increments of 1 KB, and if you hold down the R Button, you can change it in increments of 4 bytes. |
A Button | If the cursor is on an item that executes a command (that is, it has a "<b>></b>" at the start), execute the command. |
START | Leaves the session and returns to the Mode Selection screen. When the station is a session host, the session ends and all the other devices that were in the session also return to the Mode Selection screen. |