DatagramSocket.TransferOwnership Method

Definition

Overloads

TransferOwnership(String, SocketActivityContext)

Transfers ownership of the DatagramSocket to the socket brokering service, which monitors socket activity and notifies the app through a background task if there is any activity.

TransferOwnership(String)

Transfers ownership of the DatagramSocket to the socket brokering service, which monitors socket activity and notifies the app through a background task if there is any activity.

TransferOwnership(String, SocketActivityContext, TimeSpan)

Transfers ownership of the DatagramSocket to the socket brokering service, which monitors socket activity and notifies the app through a background task if there is any activity.

TransferOwnership(String, SocketActivityContext)

Transfers ownership of the DatagramSocket to the socket brokering service, which monitors socket activity and notifies the app through a background task if there is any activity.

public:
 virtual void TransferOwnership(Platform::String ^ socketId, SocketActivityContext ^ data) = TransferOwnership;
/// [Windows.Foundation.Metadata.Overload("TransferOwnershipWithContext")]
void TransferOwnership(winrt::hstring const & socketId, SocketActivityContext const & data);
[Windows.Foundation.Metadata.Overload("TransferOwnershipWithContext")]
public void TransferOwnership(string socketId, SocketActivityContext data);
function transferOwnership(socketId, data)
Public Sub TransferOwnership (socketId As String, data As SocketActivityContext)

Parameters

socketId
String

A string the app uses to identify the transferred socket. The string should identify this socket uniquely within the app. When activity occurs on this socket, this string will be provided to the app to identify the socket.

data
SocketActivityContext

Use the SocketActivityContext to pass context information through the socket broker. When your app is notified by the broker of activity, this SocketActivityContext will be provided to your app to help establish the context in which you should handle the notification.

Attributes

Remarks

Your app should call this method to transfer ownership of the DatagramSocket to the socket brokering service when the app is about to be suspended, or at the end of a background task. Your app should not access the DatagramSocket object after calling this method, except when responding to notifications from the socket brokering service.

See also

Applies to

TransferOwnership(String)

Transfers ownership of the DatagramSocket to the socket brokering service, which monitors socket activity and notifies the app through a background task if there is any activity.

public:
 virtual void TransferOwnership(Platform::String ^ socketId) = TransferOwnership;
/// [Windows.Foundation.Metadata.Overload("TransferOwnership")]
void TransferOwnership(winrt::hstring const & socketId);
[Windows.Foundation.Metadata.Overload("TransferOwnership")]
public void TransferOwnership(string socketId);
function transferOwnership(socketId)
Public Sub TransferOwnership (socketId As String)

Parameters

socketId
String

A string the app uses to identify the transferred socket. The string should identify this socket uniquely within the app. When activity occurs on this socket, this string will be provided to the app to identify the socket.

Attributes

Remarks

Your app should call this method to transfer ownership of the DatagramSocket to the socket brokering service when the app is about to be suspended, or at the end of a background task. Your app should not access the DatagramSocket object after calling this method, except when responding to notifications from the socket brokering service.

See also

Applies to

TransferOwnership(String, SocketActivityContext, TimeSpan)

Transfers ownership of the DatagramSocket to the socket brokering service, which monitors socket activity and notifies the app through a background task if there is any activity.

public:
 virtual void TransferOwnership(Platform::String ^ socketId, SocketActivityContext ^ data, TimeSpan keepAliveTime) = TransferOwnership;
/// [Windows.Foundation.Metadata.Overload("TransferOwnershipWithContextAndKeepAliveTime")]
void TransferOwnership(winrt::hstring const & socketId, SocketActivityContext const & data, TimeSpan keepAliveTime);
[Windows.Foundation.Metadata.Overload("TransferOwnershipWithContextAndKeepAliveTime")]
public void TransferOwnership(string socketId, SocketActivityContext data, System.TimeSpan keepAliveTime);
function transferOwnership(socketId, data, keepAliveTime)
Public Sub TransferOwnership (socketId As String, data As SocketActivityContext, keepAliveTime As TimeSpan)

Parameters

socketId
String

A string the app uses to identify the transferred socket. The string should identify this socket uniquely within the app. When activity occurs on this socket, this string will be provided to the app to identify the socket.

data
SocketActivityContext

Use the SocketActivityContext to pass context information through the socket broker. When your app is notified by the broker of activity, this SocketActivityContext will be provided to your app to help establish the context in which you should handle the notification.

keepAliveTime
TimeSpan

How long the socket brokering service should monitor the socket for activity.

Attributes

Remarks

Your app should call this method to transfer ownership of the DatagramSocket to the socket brokering service when the app is about to be suspended, or at the end of a background task. Your app should not access the DatagramSocket object after calling this method, except when responding to notifications from the socket brokering service.

See also

Applies to