Example #1
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);
        }