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.Net (in System.Net.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 methods: Socket.ConnectAsync, Socket.ReceiveAsync, and Socket.SendAsync.

Silverlight

Supported in: 5, 4, 3

Silverlight for Windows Phone

Supported in: Windows Phone OS 7.1

For a list of the operating systems and browsers that are supported by Silverlight, see Supported Operating Systems and Browsers.

Community Additions

Show:
© 2014 Microsoft