Exemplo n.º 1
0
        /// <summary>
        /// Handles the native callback.
        /// </summary>
        private void HandleNewServerRpc(bool success, BatchContextSafeHandle ctx)
        {
            Task.Run(() => AllowOneRpc());

            if (success)
            {
                ServerRpcNew newRpc = ctx.GetServerRpcNew(this);

                // after server shutdown, the callback returns with null call
                if (!newRpc.Call.IsInvalid)
                {
                    HandleCallAsync(newRpc);  // we don't need to await.
                }
            }
        }
Exemplo n.º 2
0
        /// <summary>
        /// Handles the native callback.
        /// </summary>
        private void HandleNewServerRpc(bool success, BatchContextSafeHandle ctx)
        {
            if (success)
            {
                ServerRpcNew newRpc = ctx.GetServerRpcNew(this);

                // after server shutdown, the callback returns with null call
                if (!newRpc.Call.IsInvalid)
                {
                    Task.Run(async() => await HandleCallAsync(newRpc)).ConfigureAwait(false);
                }
            }

            AllowOneRpc();
        }