SocketActivityInformation.AllSockets Property

Definition

Gets a list of all the sockets transferred to the socket brokering service by this app.

public:
 static property IMapView<Platform::String ^, SocketActivityInformation ^> ^ AllSockets { IMapView<Platform::String ^, SocketActivityInformation ^> ^ get(); };
static IMapView<winrt::hstring, SocketActivityInformation const&> AllSockets();
public static IReadOnlyDictionary<string,SocketActivityInformation> AllSockets { get; }
var iMapView = SocketActivityInformation.allSockets;
Public Shared ReadOnly Property AllSockets As IReadOnlyDictionary(Of String, SocketActivityInformation)

Property Value

A list of all the sockets transferred to the socket brokering service by this app.

Remarks

When a new instance of your app has become active, and you want the new instance to take ownership of the sockets that a previous instance of your app transferred to the socket broker, use the static AllSockets collection to enumerate the sockets associated with your app. For each socket in the collection, transfer ownership to the current app instance by getting the appropriate socket object (DatagramSocket, StreamSocket, or StreamSocketListener), as indicated by the SocketKind property. Using the property getter for the socket object transfers ownership of the socket back from the socket broker to your app.

Note that your code is only allowed to transfer ownership of a socket to a socket object whose type that matches the SocketActivityKind of the socket being transferred. Attempting to use the wrong type of socket object will fail.

Applies to