Compartilhar via


Introduction to Microsoft Game Development Kit networking

This topic provides an introduction to the network stack in the Microsoft Game Development Kit (GDK). The networking stack and available APIs for Microsoft Game Development Kit (GDK) titles are similar to Win32 network APIs. This simplifies porting from existing Win32 titles and allows more unified network implementations.

Available APIs

The following table summarizes the API space for the Microsoft Game Development Kit (GDK). For more information about each API for the Microsoft Game Development Kit (GDK), see its associated links.

Feature Microsoft Game Development Kit (GDK)
All-in-one solution
(network game data and in-game chat)
PlayFab Party
Secure client/server network game data transport MsQuic
REST XSAPI
HTTP** xCurl (recommended) or WinHTTP
WebSocket** libHttpClient (recommended) or WinHTTP
Sockets Winsock
Socket security OpenSSL Datagram Transport Layer Security (DTLS) or Bcrypt DTLS (Secure Game Communication) (NDA topic)Autorização obrigatória
Network connectivity XNetworkingGetConnectivityHint
Port behavior Identical to Win32 Windows PC
In-game chat PlayFab Party or Game Chat 2

**: To learn how to select which API to use, see Web requests.

New and important concepts

There are two new concepts that apply to almost every single one of the Microsoft Game Development Kit (GDK) networking APIs.

Network initialization

All networking APIs only function properly once the network is initialized. Your title should be waiting for network initialization before calling into any networking API or middleware that relies upon a networking API. For more information on network initialization, see Network initialization and connectivity.

Suspend and resume

Almost all network handles and objects created from networking APIs need to be cleaned up during your title's suspend notification. Each API overview describes how to do this for that particular area; both your title and any middleware consuming these APIs should follow this guidance. For more information on suspend and resume generally, see the Xbox Game Life Cycle (NDA topic)Autorização obrigatória overview.

Suspend and resume handling documentation:

Xbox One Software Development Kit migration

For details about titles that are migrating from the previous Xbox One Software Development Kit documentation, see Xbox One Software Development Kit migration overview (NDA topic)Autorização obrigatória. This topic includes guidance for titles that enable communication between the Xbox One Software Development Kit and the GDK title versions.

See also

Network initialization and connectivity

Web requests: HTTP and WebSocket

Windows Sockets

Game Chat 2

PlayFab Party

PlayFab Party Online Subsystem for Unreal

PlayFab Party SDK for Unity

MsQuic

Getting Started with Xbox Live APIs

Preferred UDP multiplayer port

Secure Game Communication for Microsoft Game Development Kit Titles (NDA topic)Autorização obrigatória