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

◆ ReadAsync() [3/3]

override ValueTask< int > System.Net.Sockets.NetworkStream.ReadAsync ( Memory< byte > buffer,
CancellationToken cancellationToken )
inlinevirtual

Reimplemented from System.IO.Stream.

Definition at line 402 of file NetworkStream.cs.

403 {
404 bool canRead = CanRead;
406 if (!canRead)
407 {
409 }
410 try
411 {
412 return _streamSocket.ReceiveAsync(buffer, SocketFlags.None, fromNetworkStream: true, cancellationToken);
413 }
414 catch (Exception ex) when (!(ex is OutOfMemoryException))
415 {
417 }
418 }
static IOException WrapException(string resourceFormatString, Exception innerException)
bool ReceiveAsync(SocketAsyncEventArgs e)
Definition Socket.cs:3001
static string net_io_readfailure
Definition SR.cs:158
static string net_writeonlystream
Definition SR.cs:116
Definition SR.cs:7

References System.Net.Sockets.NetworkStream._streamSocket, System.buffer, System.cancellationToken, System.Net.Sockets.NetworkStream.CanRead, System.SR.net_io_readfailure, System.SR.net_writeonlystream, System.Net.Sockets.Socket.ReceiveAsync(), System.Net.Sockets.NetworkStream.ThrowIfDisposed(), and System.Net.Sockets.NetworkStream.WrapException().