示例#1
0
        protected override void ReceiveCore(ServerRequestContext context)
        {
            this.OnReceiving();
            try
            {
                InProcPacket.ProcessReceive(this._inboundQueue, this._pendingPackets, context, this._receivingCancellationTokenSource.Token);
            }
            catch (OperationCanceledException)
            {
                context.SocketError = SocketError.OperationAborted;
            }

            this.OnReceived(context);
            this.OnReceived();
        }
示例#2
0
        protected sealed override void ReceiveCore(ClientResponseContext context)
        {
            Task.Factory.StartNew(
                () =>
            {
                try
                {
                    InProcPacket.ProcessReceive(this._inboundQueue, this._pendingPackets, context, this._linkedCancellationTokenSource.Token);
                }
                catch (OperationCanceledException)
                {
                    return;
                }

                this.OnReceived(context);
            }
                );
        }