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

◆ AcceptAsync() [4/6]

ValueTask< Socket > System.Net.Sockets.Socket.AcceptAsync ( Socket? acceptSocket,
CancellationToken cancellationToken )
inline

Definition at line 3891 of file Socket.cs.

3892 {
3893 if (cancellationToken.IsCancellationRequested)
3894 {
3896 }
3897 AwaitableSocketAsyncEventArgs awaitableSocketAsyncEventArgs = Interlocked.Exchange(ref _singleBufferSendEventArgs, null) ?? new AwaitableSocketAsyncEventArgs(this, isReceiveForCaching: false);
3898 awaitableSocketAsyncEventArgs.SetBuffer(null, 0, 0);
3899 awaitableSocketAsyncEventArgs.AcceptSocket = acceptSocket;
3900 awaitableSocketAsyncEventArgs.WrapExceptionsForNetworkStream = false;
3901 return awaitableSocketAsyncEventArgs.AcceptAsync(this, cancellationToken);
3902 }
AwaitableSocketAsyncEventArgs _singleBufferSendEventArgs
Definition Socket.cs:569
static int Exchange(ref int location1, int value)
static ValueTask FromCanceled(CancellationToken cancellationToken)
Definition ValueTask.cs:180

References System.Net.Sockets.Socket._singleBufferSendEventArgs, System.cancellationToken, System.Threading.Interlocked.Exchange(), and System.Threading.Tasks.ValueTask< TResult >.FromCanceled().