C# Class System.Net.Sockets.NetworkStream.AwaitableSocketAsyncEventArgs

A SocketAsyncEventArgs that can be awaited to get the result of an operation.
Inheritance: SocketAsyncEventArgs, ICriticalNotifyCompletion
Afficher le fichier Open project: dotnet/corefx

Private Properties

Свойство Type Description
ThrowIOSocketException void

Méthodes publiques

Méthode Description
AwaitableSocketAsyncEventArgs ( Socket socket, byte buffer ) : System.Buffers

Initializes the event args.

GetAwaiter ( ) : AwaitableSocketAsyncEventArgs

Gets this instance.

GetResult ( ) : int

Gets the result of the completion operation.

Unlike Task's awaiter's GetResult, this does not block until the operation completes: it must only be used once the operation has completed. This is handled implicitly by await.

OnCompleted ( Action continuation ) : void

Queues the provided continuation to be executed once the operation has completed.

ReceiveAsync ( ) : AwaitableSocketAsyncEventArgs

Initiates a receive operation on the associated socket.

UnsafeOnCompleted ( Action continuation ) : void

Same as OnCompleted(Action)

Private Methods

Méthode Description
ThrowIOSocketException ( ) : void

Method Details

AwaitableSocketAsyncEventArgs() public méthode

Initializes the event args.
public AwaitableSocketAsyncEventArgs ( Socket socket, byte buffer ) : System.Buffers
socket Socket The associated socket.
buffer byte The buffer to use for all operations.
Résultat System.Buffers

GetAwaiter() public méthode

Gets this instance.
public GetAwaiter ( ) : AwaitableSocketAsyncEventArgs
Résultat AwaitableSocketAsyncEventArgs

GetResult() public méthode

Gets the result of the completion operation.
Unlike Task's awaiter's GetResult, this does not block until the operation completes: it must only be used once the operation has completed. This is handled implicitly by await.
public GetResult ( ) : int
Résultat int

OnCompleted() public méthode

Queues the provided continuation to be executed once the operation has completed.
public OnCompleted ( Action continuation ) : void
continuation Action
Résultat void

ReceiveAsync() public méthode

Initiates a receive operation on the associated socket.
public ReceiveAsync ( ) : AwaitableSocketAsyncEventArgs
Résultat AwaitableSocketAsyncEventArgs

UnsafeOnCompleted() public méthode

Same as OnCompleted(Action)
public UnsafeOnCompleted ( Action continuation ) : void
continuation Action
Résultat void