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

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

Private Properties

Property Type Description
ThrowIOSocketException void

Public Methods

Method 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

Method Description
ThrowIOSocketException ( ) : void

Method Details

AwaitableSocketAsyncEventArgs() public method

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.
return System.Buffers

GetAwaiter() public method

Gets this instance.
public GetAwaiter ( ) : AwaitableSocketAsyncEventArgs
return AwaitableSocketAsyncEventArgs

GetResult() public method

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
return int

OnCompleted() public method

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

ReceiveAsync() public method

Initiates a receive operation on the associated socket.
public ReceiveAsync ( ) : AwaitableSocketAsyncEventArgs
return AwaitableSocketAsyncEventArgs

UnsafeOnCompleted() public method

Same as OnCompleted(Action)
public UnsafeOnCompleted ( Action continuation ) : void
continuation Action
return void