SocketAsyncEventArgs.UserToken Property
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
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
- AcceptAsync(SocketAsyncEventArgs)
- ConnectAsync(SocketAsyncEventArgs)
- DisconnectAsync(SocketAsyncEventArgs)
- ReceiveAsync(SocketAsyncEventArgs)
- ReceiveFromAsync(SocketAsyncEventArgs)
- ReceiveMessageFromAsync(SocketAsyncEventArgs)
- SendAsync(SocketAsyncEventArgs)
- SendPacketsAsync(SocketAsyncEventArgs)
- SendToAsync(SocketAsyncEventArgs)