3. PiaLocal Guide

Introduction

This chapter describes the features and programming procedures of the PiaLocal module in Pia. For more information, see the API reference.

Feature Overview

The PiaLocal module provides extended P2P communication features. This extends the UDS library to allow use of features with more advanced functionality. PiaLocal is used with PiaSession.

Comparison of Implementation Methods

There are several ways to support local communication. This document describes some characteristics of each method.

Using the SDK UDS Library Directly

Using the UDS library directly enables use of basic communication features. A separate communication thread must be started in the application because the UDS send and receive functions can block for a relatively long time. Also, to make use of reliable communications and packet bundling, you must implement them separately in the application.

Using PiaLocal and PiaSession

Using PiaSession enables code written for local communications to be reused for Internet communications (and vice versa). It also enables use of PiaTransport features such as reliable communication and packet bundling. PiaSession supports multiple platforms and will facilitate migration of features to other Nintendo platforms in the future. Use of some PiaSession features may increase CPU load, but PiaTransport is designed to minimize CPU load. (For more information, see the separately provided document Pia Measurement Information.)

The following table summarizes the primary features supported in each library.

  nn::uds PiaLocal + PiaSession
Shared Code for Local and Internet Communication X O
Sending and Receiving Threads in the Library X O
Pia Protocols (Such as ReliableProtocol and ReliableBroadcastProtocol) X O
Packet Bundling X O
Host Migration X O
Nearby Network Search X O
Other Features (such as getting the sync clock and the RTT) X O
Debug Support Features (such as latency emulation and tracing) X O
Multiplatform Support X O

O: Supported    X: Not supported