Terraria v1.4.4.9
Terraria source code documentation
All Classes Namespaces Files Functions Variables Enumerations Enumerator Properties Events Macros

◆ OnCompleted() [1/7]

void System.Net.Sockets.Socket.AwaitableSocketAsyncEventArgs.OnCompleted ( Action< object > continuation,
object state,
short token,
ValueTaskSourceOnCompletedFlags flags )
inline

Definition at line 312 of file Socket.cs.

313 {
314 if (token != _token)
315 {
317 }
318 if ((flags & ValueTaskSourceOnCompletedFlags.FlowExecutionContext) != 0)
319 {
321 }
322 if ((flags & ValueTaskSourceOnCompletedFlags.UseSchedulingContext) != 0)
323 {
325 if (current != null && current.GetType() != typeof(SynchronizationContext))
326 {
327 _scheduler = current;
328 }
329 else
330 {
333 {
335 }
336 }
337 }
338 base.UserToken = state;
340 if ((object)action == s_completedSentinel)
341 {
343 _executionContext = null;
344 base.UserToken = null;
346 }
347 else if (action != null)
348 {
350 }
351 }
static readonly Action< object > s_completedSentinel
Definition Socket.cs:47
void InvokeContinuation(Action< object > continuation, object state, bool forceAsync, bool requiresExecutionContextFlow)
Definition Socket.cs:353
static ? ExecutionContext Capture()
static int CompareExchange(ref int location1, int value, int comparand)
static ? SynchronizationContext Current

References System.Net.Sockets.Socket.AwaitableSocketAsyncEventArgs._continuation, System.Net.Sockets.Socket.AwaitableSocketAsyncEventArgs._executionContext, System.Net.Sockets.Socket.AwaitableSocketAsyncEventArgs._scheduler, System.Net.Sockets.Socket.AwaitableSocketAsyncEventArgs._token, System.action, System.Threading.ExecutionContext.Capture(), System.Threading.Interlocked.CompareExchange(), System.Threading.Tasks.TaskScheduler.Current, System.Threading.SynchronizationContext.Current, System.Threading.Tasks.TaskScheduler.Default, System.Net.Sockets.Socket.AwaitableSocketAsyncEventArgs.InvokeContinuation(), System.Net.Sockets.Socket.AwaitableSocketAsyncEventArgs.s_completedSentinel, System.state, System.Net.Sockets.Socket.AwaitableSocketAsyncEventArgs.ThrowIncorrectTokenException(), and System.Net.Sockets.Socket.AwaitableSocketAsyncEventArgs.ThrowMultipleContinuationsException().