Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches

◆ ReadAsync() [3/3]

override ValueTask< int > System.IO.Pipes.PipeStream.ReadAsync ( Memory< byte > buffer,
CancellationToken cancellationToken = default(CancellationToken) )
inlinevirtual

Reimplemented from System.IO.Stream.

Definition at line 693 of file PipeStream.cs.

694 {
695 if (!_isAsync)
696 {
697 return base.ReadAsync(buffer, cancellationToken);
698 }
699 if (!CanRead)
700 {
701 throw Error.GetReadNotSupported();
702 }
703 if (cancellationToken.IsCancellationRequested)
704 {
706 }
708 if (buffer.Length == 0)
709 {
710 UpdateMessageCompletion(completion: false);
711 return new ValueTask<int>(0);
712 }
714 }
unsafe ValueTask< int > ReadAsyncCore(Memory< byte > buffer, CancellationToken cancellationToken)
void UpdateMessageCompletion(bool completion)
static ValueTask FromCanceled(CancellationToken cancellationToken)
Definition ValueTask.cs:180

References System.IO.Pipes.PipeStream._isAsync, System.buffer, System.cancellationToken, System.IO.Pipes.PipeStream.CanRead, System.IO.Pipes.PipeStream.CheckReadOperations(), System.Threading.Tasks.ValueTask< TResult >.FromCanceled(), System.IO.Error.GetReadNotSupported(), System.IO.Pipes.PipeStream.ReadAsyncCore(), and System.IO.Pipes.PipeStream.UpdateMessageCompletion().