Example #1
0
            static void OnReadHeaderComplete(TransportAsyncCallbackArgs args)
            {
                TransportHandler thisPtr = (TransportHandler)args.UserToken;

                if (args.Exception != null)
                {
                    thisPtr.parent.OnHandleTransportComplete(args);
                    return;
                }

                ByteBuffer buffer = new ByteBuffer(thisPtr.buffer, 0, thisPtr.buffer.Length);

                try
                {
                    thisPtr.OnProtocolHeader(buffer);
                }
                catch (Exception exp)
                {
                    if (Fx.IsFatal(exp))
                    {
                        throw;
                    }

                    AmqpTrace.Provider.AmqpLogError(thisPtr, "OnProtocolHeader", exp.Message);
                    args.Exception = exp;
                    thisPtr.parent.OnHandleTransportComplete(args);
                }
            }