예제 #1
0
        public SocketPipe(
            IProtocolUnpacker unpacker,
            IProtocolCoder <TKey, TProtocol> protocolCoder,
            Dictionary <TKey, Type> messageMapping,
            IMessageSerializer messageSerializer,
            Dictionary <TKey, IMessageHandle <TKey, TProtocol> > messageHandle)
        {
            _unpacker          = unpacker ?? throw new ArgumentNullException(nameof(unpacker));
            _protocolCoder     = protocolCoder ?? throw new ArgumentNullException(nameof(protocolCoder));
            _messageMapping    = messageMapping ?? throw new ArgumentNullException(nameof(messageMapping));
            _messageSerializer = messageSerializer ?? throw new ArgumentNullException(nameof(messageSerializer));
            _messageHandle     = messageHandle ?? throw new ArgumentNullException(nameof(messageHandle));

            SendPipe    = InitSend();
            ReceivePipe = InitReceive();
        }
예제 #2
0
파일: Builder.cs 프로젝트: noSet/SocketDemo
 internal BuilderCore(IProtocolUnpacker unpacker, IProtocolCoder <TKey, TProtocol> coder)
 {
     _unpacker      = unpacker;
     _protocolCoder = coder;
 }