protected AbstractProtocolFactory(string name, IClientFactory clientFactory, ProtocolOptions options)
 {
     m_client  = clientFactory.Client();
     m_options = options;
     m_pool    = new LazyPool <IProtocol>(
         new SynchronizedPool <IProtocol>(m_sync,
                                          new StackPool <IProtocol>(name, options.MaxPoolSize),
                                          options.PoolAccessTimeout),
         CreateFactory, ReleaseFactory);
 }
示例#2
0
        public DefaultProtocol(IProtocolFactory factory,
                               ProtocolOptions options)
        {
            m_buffer  = new Buffer <byte>(options.BufferSize);
            m_factory = factory;
            Options   = options;

            m_keyEncoder    = factory.CreateEncoder();
            m_builder       = factory.CreatePacketBuilder(m_buffer);
            m_formatter     = factory.CreateObjectFormatter();
            m_commandWriter = factory.CreateCommandWriter(m_builder);
        }
示例#3
0
 public TextProtocolFactory(IClientFactory clientFactory, ProtocolOptions options)
     : base("TextProtocol", clientFactory, options)
 {
 }
 public BinaryProtocolFactory(IClientFactory clientFactory, ProtocolOptions options)
     : base("BinaryProtocol", clientFactory, options)
 {
 }