UserToken Property

SocketAsyncEventArgs.UserToken Property

 

Gets or sets a user or application object associated with this asynchronous socket operation.

Namespace:   System.Net.Sockets
Assembly:  System (in System.dll)

public object UserToken { get; set; }

Property Value

Type: System.Object

An object that represents the user or application object associated with this asynchronous socket operation.

This property can be used by an application to associate an application state object with the SocketAsyncEventArgs object. Primarily, this property is a way for an application to pass state to the application’s event handler (for example, the asynchronous operation completion method).

This property is used with all of the asynchronous socket (xxxAsync) methods.

Universal Windows Platform
Available since 10
.NET Framework
Available since 2.0
Silverlight
Available since 2.0
Windows Phone Silverlight
Available since 7.1
Return to top
Show:
© 2016 Microsoft