SecureDeviceAssociation.GetRemoteSocketAddressBytes Method

Fills in a byte array with the remote socket address.

This method fills the specified byte buffer with the SOCKADDR_STORAGE address of the remote device for the Xbox Secure Device Association to be used in subsequent Winsock operations.

Syntax

public:
void GetRemoteSocketAddressBytes(
         out Array<unsigned char>^ socketAddressBytes
)  

Parameters

socketAddressBytes
Type: unsigned char 

 The buffer to be filled. Must be at least sizeof(SOCKADDR_STORAGE).

Remarks

The port number value will be zero if the Xbox Secure Device Association Template allowed dynamically-assigned port numbers in its corresponding SecureDeviceSocketDescription. In this case, the title will have to determine the remote port number through external means.

The peer address returned by this property is only valid on the calling device; to retrieve a network identity that can be shared with other peers, use the corresponding SecureDeviceAddress object and its Buffer property to retrieve a serialized data block.

Note When GetRemoteSocketAddressBytes is called in Xbox Live Compute game server code, traffic from consoles behind a common NAT, it returns the same address to all consoles behind the NAT, but distinct ports for each console. So when your Xbox Live Compute server code is comparing two SOCKADDR_STORAGE structures returned by GetRemoteSocketAddressBytes, you must compare both the address members and the port members in order to determine whether both structures refer to the same console. For example, if the ss_family indicates that two SOCKADDR_STORAGE structures are both sockaddr_in6 (IPv6) addresses, then they refer to the same console only if both the sin6_addr members and the sin6_port values are the same.

Requirements

Namespace: Windows.Xbox.Networking

Metadata: windows.winmd

See also

Reference

SecureDeviceAssociation Class

SecureDeviceAssociation Members

Windows.Xbox.Networking Namespace