Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Export (0) Print
Expand All

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)

member UserToken : Object with 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.

.NET Framework

Supported in: 4.6, 4.5, 4, 3.5 SP1, 3.0 SP1, 2.0 SP1

.NET Framework Client Profile

Supported in: 4, 3.5 SP1

Supported in: Windows Phone 8.1

Supported in: Windows Phone Silverlight 8.1

Supported in: Windows Phone Silverlight 8
Show:
© 2015 Microsoft