Example #1
0
        bool GetReadResult()
        {
            offset = 0;
            size   = Connection.EndRead();
            if (size == 0)
            {
                if (decoder.StreamPosition == 0) // client timed out a cached connection
                {
                    base.Close(GetRemainingTimeout());
                    return(false);
                }
                else
                {
                    throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(decoder.CreatePrematureEOFException());
                }
            }

            // restore ExceptionEventType to Error after the initial read for cached connections
            Connection.ExceptionEventType = TraceEventType.Error;

            if (buffer == null)
            {
                buffer = Connection.AsyncReadBuffer;
            }

            return(true);
        }
Example #2
0
        bool GetReadResult()
        {
            offset = 0;
            size   = Connection.EndRead();
            if (size == 0)
            {
                if (this.decoder.StreamPosition == 0) // client timed out a cached connection
                {
                    base.Close(GetRemainingTimeout());
                    return(false);
                }
                else
                {
                    throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(decoder.CreatePrematureEOFException());
                }
            }

            if (buffer == null)
            {
                buffer = Connection.AsyncReadBuffer;
            }

            return(true);
        }