• WC框架


    ChannelDispatcher 字段

    public class ChannelDispatcher : ChannelDispatcherBase
    {
        // Fields
        private ThreadSafeMessageFilterTable<EndpointAddress> addressTable;
        private string bindingName;
        private SynchronizedCollection<IChannelInitializer> channelInitializers;//通道初始化器
        private CommunicationObjectManager<IChannel> channels;//通道管理器
        private EndpointDispatcherCollection endpointDispatchers;
        private ErrorBehavior errorBehavior;
        private Collection<IErrorHandler> errorHandlers;//错误处理器
        private EndpointDispatcherTable filterTable;
        private ServiceHostBase host;
        private bool includeExceptionDetailInFaults;
        private bool isTransactedReceive;
        private readonly IChannelListener listener;
        private ListenerHandler listenerHandler;//
        private int maxPendingReceives;
        private int maxTransactedBatchSize;
        private MessageVersion messageVersion;
        private SynchronizedChannelCollection<IChannel> pendingChannels;
        private bool performDefaultCloseInput;
        private bool receiveContextEnabled;
        private bool receiveSynchronously;
        private bool sendAsynchronously;
        private ServiceThrottle serviceThrottle;
        private bool session;
        private SharedRuntimeState shared;
        private IDefaultCommunicationTimeouts timeouts;
        private IsolationLevel transactionIsolationLevel;
        private bool transactionIsolationLevelSet;
        private TimeSpan transactionTimeout;

    }

    ChannelHandle:

    private void HandleReceiveComplete(RequestContext context)
    {
        if ((context == null) && this.incrementedActivityCountInConstructor)
        {
            this.listener.ChannelDispatcher.Channels.DecrementActivityCount();
        }
        if (this.channel != null)
        {
            this.channel.HandleReceiveComplete(context);
        }
        else if ((context == null) && this.hasSession)
        {
            bool flag;
            lock (this.ThisLock)
            {
                flag = !this.doneReceiving;
                this.doneReceiving = true;
            }
            if (flag)
            {
                this.receiver.Close();
                if (this.idleManager != null)
                {
                    this.idleManager.CancelTimer();
                }
                ServiceThrottle throttle = this.throttle;
                if (throttle != null)
                {
                    throttle.DeactivateChannel();
                }
            }
        }
    }

  • 相关阅读:
    学习进度——第十周
    梦断代码读后感03
    DFS入门——数的拆分
    DFS入门——素数环问题
    排列LCS问题
    洛谷P1436 棋盘分割 题解 二维区间DP
    洛谷P1241 括号序列 题解 栈
    《算法艺术与信息学竞赛》第1章 算法与数据结构 学习笔记
    洛谷P1563 玩具谜题(NOIP提高组2016 D1T1)题解 模拟
    洛谷P5022 旅行(NOIP提高组2018 D2T1)题解 贪心/去环
  • 原文地址:https://www.cnblogs.com/qianyz/p/2690372.html
Copyright © 2020-2023  润新知