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

◆ ReceiveAsync()

ValueTask< int > System.Net.Sockets.Socket.AwaitableSocketAsyncEventArgs.ReceiveAsync ( Socket socket,
CancellationToken cancellationToken )
inline

Definition at line 127 of file Socket.cs.

128 {
129 if (socket.ReceiveAsync(this, cancellationToken))
130 {
132 return new ValueTask<int>(this, _token);
133 }
134 int bytesTransferred = base.BytesTransferred;
135 SocketError socketError = base.SocketError;
136 Release();
137 if (socketError != 0)
138 {
140 }
142 }
Exception CreateException(SocketError error, bool forAsyncThrow=true)
Definition Socket.cs:503
static ValueTask FromException(Exception exception)
Definition ValueTask.cs:190

References System.Net.Sockets.Socket.AwaitableSocketAsyncEventArgs._cancellationToken, System.Net.Sockets.Socket.AwaitableSocketAsyncEventArgs._token, System.cancellationToken, System.Net.Sockets.Socket.AwaitableSocketAsyncEventArgs.CreateException(), System.Threading.Tasks.ValueTask< TResult >.FromException(), and System.Net.Sockets.Socket.AwaitableSocketAsyncEventArgs.Release().