/// <summary> /// Handles the native callback. /// </summary> private void HandleNewServerRpc(bool success, BatchContextSafeHandle ctx) { if (success) { ServerRpcNew newRpc = ctx.GetServerRpcNew(); // after server shutdown, the callback returns with null call if (!newRpc.Call.IsInvalid) { Task.Run(async () => await HandleCallAsync(newRpc)); } } AllowOneRpc(); }