SocketActivityInformation SocketActivityInformation SocketActivityInformation SocketActivityInformation Class

Definition

Provides information on the transferred socket from the Socket Broker.

public : sealed class SocketActivityInformation : ISocketActivityInformationpublic sealed class SocketActivityInformation : ISocketActivityInformationPublic NotInheritable Class SocketActivityInformation Implements ISocketActivityInformation// You can use this class in JavaScript.
Attributes
Windows 10 requirements
Device family
Windows 10 (introduced v10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v1)

Remarks

You can get an instance of this class from the static SocketActivityInformation.AllSockets collection, or from the SocketActivityTriggerDetails object passed to your SocketActivityTrigger event handler.

Properties

AllSockets AllSockets AllSockets AllSockets

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

public : static IMapView<string, SocketActivityInformation> AllSockets { get; }public static IReadOnlyDictionary<string, SocketActivityInformation> AllSockets { get; }Public Static ReadOnly Property AllSockets As IReadOnlyDictionary<string, SocketActivityInformation>// You can use this property in JavaScript.
Value
IMapView<PlatForm::String, SocketActivityInformation> IReadOnlyDictionary<string, SocketActivityInformation> IReadOnlyDictionary<string, SocketActivityInformation> IReadOnlyDictionary<string, SocketActivityInformation>

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.

Context Context Context Context

Get the context associated while transferring ownership of the socket.

public : SocketActivityContext Context { get; }public SocketActivityContext Context { get; }Public ReadOnly Property Context As SocketActivityContext// You can use this property in JavaScript.
Value
SocketActivityContext SocketActivityContext SocketActivityContext SocketActivityContext

The context associated while transferring ownership of the socket.

See Also

DatagramSocket DatagramSocket DatagramSocket DatagramSocket

Based on the socket type, the app can reclaim the ownership of the appropriate DatagramSocket.

public : DatagramSocket DatagramSocket { get; }public DatagramSocket DatagramSocket { get; }Public ReadOnly Property DatagramSocket As DatagramSocket// You can use this property in JavaScript.

Id Id Id Id

A unique string for this app used to identify the transferred socket. This is passed by the app while transferring the socket ownership to the service.

public : PlatForm::String Id { get; }public string Id { get; }Public ReadOnly Property Id As string// You can use this property in JavaScript.
Value
PlatForm::String string string string

A unique string to identify the transferred socket.

SocketKind SocketKind SocketKind SocketKind

Gets a SocketActivityKind enumeration value that identifies socket kind.

public : SocketActivityKind SocketKind { get; }public SocketActivityKind SocketKind { get; }Public ReadOnly Property SocketKind As SocketActivityKind// You can use this property in JavaScript.

StreamSocket StreamSocket StreamSocket StreamSocket

Based on the socket type, the app can reclaim the ownership of the appropriate StreamSocket.

public : StreamSocket StreamSocket { get; }public StreamSocket StreamSocket { get; }Public ReadOnly Property StreamSocket As StreamSocket// You can use this property in JavaScript.

StreamSocketListener StreamSocketListener StreamSocketListener StreamSocketListener

Based on the socket type, the app can reclaim the ownership of the appropriate StreamSocketListener.

public : StreamSocketListener StreamSocketListener { get; }public StreamSocketListener StreamSocketListener { get; }Public ReadOnly Property StreamSocketListener As StreamSocketListener// You can use this property in JavaScript.

TaskId TaskId TaskId TaskId

The background task ID used while transferring ownership of the socket.

public : PlatForm::Guid TaskId { get; }public Guid TaskId { get; }Public ReadOnly Property TaskId As Guid// You can use this property in JavaScript.
Value
PlatForm::Guid Guid Guid Guid

The background task ID.

See Also