XNetworkingQueryPreferredLocalUdpMultiplayerPort
Gets the preferred local UDP port to use for multiplayer traffic.Syntax
Parameters
preferredLocalUdpMultiplayerPort _Out_Type: uint16_t* Pointer to the User Datagram Protocol (UDP) port number (in host endian format) that is the preferred local UDP multiplayer port.
Return value
Type: HRESULT HRESULT success or error code.Remarks
This function isn’t safe to call on a time-sensitive thread. For more information, see Time-sensitive threads.
INADDR_ANY/in6addr_any address.
The port is returned from this function in host endian order. The
sockaddr_in::sin_port and sockaddr_in6::sin6_port fields are both in network endian order. Use the htons function to convert the endianness of the returned port when passing it to the bind function.Requirements
Header: XNetworking.h Library: xgameruntime.lib Supported platforms: Windows, XBOX One family consoles and XBOX Series consolesConceptual documentation
See also
Preferred local UDP multiplayer port networking APIsWindows Sockets (Winsock)
Microsoft Azure PlayFab Party
XNetworking
