StreamSocket.TransferOwnership StreamSocket.TransferOwnership StreamSocket.TransferOwnership StreamSocket.TransferOwnership StreamSocket.TransferOwnership Method

Definition

Overloads

TransferOwnership(String) TransferOwnership(String) TransferOwnership(String) TransferOwnership(String) TransferOwnership(String)

Transfers ownership of the StreamSocket 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) TransferOwnership(String, SocketActivityContext) TransferOwnership(String, SocketActivityContext) TransferOwnership(String, SocketActivityContext) TransferOwnership(String, SocketActivityContext)

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

TransferOwnership(String, SocketActivityContext, TimeSpan) TransferOwnership(String, SocketActivityContext, TimeSpan) TransferOwnership(String, SocketActivityContext, TimeSpan) TransferOwnership(String, SocketActivityContext, TimeSpan) TransferOwnership(String, SocketActivityContext, TimeSpan)

Transfers ownership of the StreamSocket to the socket brokering service, which monitors socket activity and notifies the app through a background task if there is any activity. Specifies a new SocketActivityContext and a keep alive time for the socket.

TransferOwnership(String) TransferOwnership(String) TransferOwnership(String) TransferOwnership(String) TransferOwnership(String)

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

public : void TransferOwnership(Platform::String socketId)
void TransferOwnership(winrt::hstring socketId) const;
public void TransferOwnership(String socketId)
Public Sub TransferOwnership(socketId As String)
streamSocket.transferOwnership(socketId);
Parameters
socketId
String String 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.

Remarks

Your app should call this method to transfer ownership of the StreamSocket 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 StreamSocket object after calling this method, except when responding to notifications from the socket brokering service.

Note

This call fails if there is any pending I/O on the StreamSocket. Your code should call StreamSocket.CancelIOAsync to cancel any further new traffic, then handle all pending traffic, and then update the SocketActivityContext, before calling StreamSocket.TransferOwnership.

See Also

TransferOwnership(String, SocketActivityContext) TransferOwnership(String, SocketActivityContext) TransferOwnership(String, SocketActivityContext) TransferOwnership(String, SocketActivityContext) TransferOwnership(String, SocketActivityContext)

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

public : void TransferOwnership(Platform::String socketId, SocketActivityContext data)
void TransferOwnership(winrt::hstring socketId, SocketActivityContext data) const;
public void TransferOwnership(String socketId, SocketActivityContext data)
Public Sub TransferOwnership(socketId As String, data As SocketActivityContext)
streamSocket.transferOwnership(socketId, data);
Parameters
socketId
String String 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 SocketActivityContext 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.

Remarks

Your app should call this method to transfer ownership of the StreamSocket 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 StreamSocket object after calling this method, except when responding to notifications from the socket brokering service.

Note

This call fails if there is any pending I/O on the StreamSocket. Your code should call StreamSocket.CancelIOAsync to cancel any further new traffic, then handle all pending traffic, and then update the SocketActivityContext, before calling StreamSocket.TransferOwnership.

See Also

TransferOwnership(String, SocketActivityContext, TimeSpan) TransferOwnership(String, SocketActivityContext, TimeSpan) TransferOwnership(String, SocketActivityContext, TimeSpan) TransferOwnership(String, SocketActivityContext, TimeSpan) TransferOwnership(String, SocketActivityContext, TimeSpan)

Transfers ownership of the StreamSocket to the socket brokering service, which monitors socket activity and notifies the app through a background task if there is any activity. Specifies a new SocketActivityContext and a keep alive time for the socket.

public : void TransferOwnership(Platform::String socketId, SocketActivityContext data, TimeSpan keepAliveTime)
void TransferOwnership(winrt::hstring socketId, SocketActivityContext data, TimeSpan keepAliveTime) const;
public void TransferOwnership(String socketId, SocketActivityContext data, TimeSpan keepAliveTime)
Public Sub TransferOwnership(socketId As String, data As SocketActivityContext, keepAliveTime As TimeSpan)
streamSocket.transferOwnership(socketId, data, keepAliveTime);
Parameters
socketId
String String 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 SocketActivityContext 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 TimeSpan TimeSpan

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

Remarks

Your app should call this method to transfer ownership of the StreamSocket 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 StreamSocket object after calling this method, except when responding to notifications from the socket brokering service.

Note

This call fails if there is any pending I/O on the StreamSocket. Your code should call StreamSocket.CancelIOAsync to cancel any further new traffic, then handle all pending traffic, and then update the SocketActivityContext, before calling StreamSocket.TransferOwnership.

See Also