SetProtocolSetHandler를 사용할 수 있는 IChannelPipe
Inheritance: IChannelPipe
Exemplo n.º 1
0
 public static ChannelPipe CreateChannelPipe(IPacketEncoder encoder, IPacketDecoder decoder, IChannelHandler handler)
 {
     var pipe = new ChannelPipe();
     pipe.SetCreateChannelAction((channel) =>
     {
         channel.SetConfig("encoder", encoder);
         channel.SetConfig("decoder", decoder);
         channel.SetConfig("handler", handler);
     });
     return pipe;
 }
Exemplo n.º 2
0
 private static void SetFactoryOption(ChannelPipe pipe)
 {
     PacketEncoder encoder = new PacketEncoder();
     pipe.SetProtocol(() => new ModifiableProtocol(encoder: encoder, decoder: encoder));
     pipe.SetHandler(() => Handler);
 }