-api-id | -api-type |
---|---|
M:Windows.Networking.Sockets.DatagramSocket.TransferOwnership(System.String,Windows.Networking.Sockets.SocketActivityContext,Windows.Foundation.TimeSpan) |
winrt method |
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.
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.
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.
How long the socket brokering service should monitor the socket for activity.
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.
TransferOwnership(String), TransferOwnership(String, SocketActivityContext)