ListenerSessionConnectionReader.cs source code in C# .NET

Source code for the .NET framework in C#

                        

Code:

/ WCF / WCF / 3.5.30729.1 / untmp / Orcas / SP / ndp / cdf / src / WCF / SMSvcHost / System / ServiceModel / Activation / ListenerSessionConnectionReader.cs / 1 / ListenerSessionConnectionReader.cs

                            //------------------------------------------------------------ 
// Copyright (c) Microsoft Corporation.  All rights reserved.
//-----------------------------------------------------------

namespace System.ServiceModel.Activation 
{
    using System.ServiceModel.Channels; 
 
    class ListenerSessionConnectionReader : DupHandleConnectionReader
    { 
        ServerSessionDecoder decoder;

        public ListenerSessionConnectionReader(IConnection connection,
            ItemDequeuedCallback connectionDequeuedCallback, TransportType transportType, 
            long streamPosition, int offset, int size,
            ConnectionClosedCallback closedCallback, ViaDecodedCallback viaDecodedCallback) 
            : base(connection, connectionDequeuedCallback, transportType, offset, size, closedCallback, viaDecodedCallback) 
        {
            this.decoder = new ServerSessionDecoder(streamPosition, ListenerConstants.MaxUriSize, ListenerConstants.SharedMaxContentTypeSize); 
        }

        protected override bool CanDupHandle(out Uri via)
        { 
            if (decoder.CurrentState == ServerSessionDecoder.State.PreUpgradeStart)
            { 
                via = decoder.Via; 
                return true;
            } 
            else
            {
                via = null;
                return false; 
            }
        } 
 
        protected override int Decode(byte[] buffer, int offset, int size)
        { 
            return decoder.Decode(buffer, offset, size);
        }

        protected override Exception CreatePrematureEOFException() 
        {
            return decoder.CreatePrematureEOFException(); 
        } 
    }
} 

// File provided for Reference Use Only by Microsoft Corporation (c) 2007.
// Copyright (c) Microsoft Corporation. All rights reserved.


                        

Link Menu

Network programming in C#, Network Programming in VB.NET, Network Programming in .NET
This book is available now!
Buy at Amazon US or
Buy at Amazon UK