Bewerken

Share via


SocketAsyncEventArgs.UserToken Property

Definition

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

public:
 property System::Object ^ UserToken { System::Object ^ get(); void set(System::Object ^ value); };
public object UserToken { get; set; }
public object? UserToken { get; set; }
member this.UserToken : obj with get, set
Public Property UserToken As Object

Property Value

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

Remarks

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.

Applies to

See also