Skip to content

Latest commit

 

History

History
31 lines (22 loc) · 1.91 KB

datagramsocket_transferownership_821274176.md

File metadata and controls

31 lines (22 loc) · 1.91 KB
-api-id -api-type
M:Windows.Networking.Sockets.DatagramSocket.TransferOwnership(System.String,Windows.Networking.Sockets.SocketActivityContext,Windows.Foundation.TimeSpan)
winrt method

Windows.Networking.Sockets.DatagramSocket.TransferOwnership

-description

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.

-parameters

-param socketId

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.

-param data

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.

-param keepAliveTime

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

-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.

-examples

-see-also

TransferOwnership(String), TransferOwnership(String, SocketActivityContext)