public TMultiplexedServiceProcessor(ILogger logger, ITransportMessageDecoder transportMessageDecoder, ITransportMessageEncoder transportMessageEncoder, ServerHandler serverHandler) { _logger = logger; _transportMessageDecoder = transportMessageDecoder; _transportMessageEncoder = transportMessageEncoder; _serverHandler = serverHandler; }
public ThriftServerMessageListener(ILogger <ThriftServerMessageListener> logger, IThriftServiceEntryProvider thriftServiceEntryProvider, ITransportMessageCodecFactory codecFactory) { _logger = logger; _transportMessageEncoder = codecFactory.GetEncoder(); _transportMessageDecoder = codecFactory.GetDecoder(); _entries = thriftServiceEntryProvider.GetEntries().ToList(); }
public DotNettyHttpServerMessageListener(ILogger <DotNettyHttpServerMessageListener> logger, ITransportMessageCodecFactory codecFactory, ISerializer <string> serializer) { _logger = logger; _transportMessageEncoder = codecFactory.GetEncoder(); _transportMessageDecoder = codecFactory.GetDecoder(); _serializer = serializer; }
public void TestCodec() { Person person = new Person { Name = "张宏伟", Age = 18 }; TransportMessage transportMessage = new TransportMessage { Id = "1", ContentType = "Person", Content = person }; MessagePackTransportMessageCodecFactory factory = new MessagePackTransportMessageCodecFactory(); ITransportMessageEncoder encoder = factory.GetEncoder(); ITransportMessageDecoder decoder = factory.GetDecoder(); byte[] vs = encoder.Encode(transportMessage); TransportMessage message = decoder.Decode(vs); Assert.AreEqual(message.Id, "1"); Assert.AreEqual(message.ContentType, "Person"); Assert.AreEqual(((object[])message.Content)[0].ToString(), "张宏伟"); Assert.AreEqual(((object[])message.Content)[1].ToString(), "18"); }
public DotNettyTransportClientFactory(ITransportMessageCodecFactory codecFactory, IHealthCheckService healthCheckService, ILogger <DotNettyTransportClientFactory> logger, IServiceExecutor serviceExecutor) { _transportMessageEncoder = codecFactory.GetEncoder(); _transportMessageDecoder = codecFactory.GetDecoder(); _logger = logger; _healthCheckService = healthCheckService; _serviceExecutor = serviceExecutor; _bootstrap = GetBootstrap(); _bootstrap.Handler(new ActionChannelInitializer <ISocketChannel>(c => { var pipeline = c.Pipeline; pipeline.AddLast(new LengthFieldPrepender(4)); pipeline.AddLast(new LengthFieldBasedFrameDecoder(int.MaxValue, 0, 4, 0, 4)); if (AppConfig.ServerOptions.EnableHealthCheck) { pipeline.AddLast(new IdleStateHandler(0, AppConfig.ServerOptions.HealthCheckWatchIntervalInSeconds, 0)); pipeline.AddLast(DotNettyConstants.HeartBeatName, new HeartBeatHandler(_healthCheckService, this)); } pipeline.AddLast(DotNettyConstants.TransportMessageAdapterName, new TransportMessageChannelHandlerAdapter(_transportMessageDecoder)); pipeline.AddLast(DotNettyConstants.ClientChannelHandler, new DefaultChannelHandler(this, healthCheckService)); })); }
public SimpleMessageDispatcher(IMessageListener messageListener, ITransportMessageCodecFactory transportMessageCodecFactory, ILogger logger) { _messageListener = messageListener; _logger = logger; _transportMessageEncoder = transportMessageCodecFactory.GetEncoder(); _transportMessageDecoder = transportMessageCodecFactory.GetDecoder(); }
public ThriftTransportClientFactory(ITransportMessageCodecFactory codecFactory, CommandLineApplication app, IConsole console) { _transportMessageEncoder = codecFactory.GetEncoder(); _transportMessageDecoder = codecFactory.GetDecoder(); _app = app; _console = console; }
/// <summary> /// Initializes a new instance of the <see cref="DotNettyUdpServerMessageListener" /> class. /// </summary> /// <param name="logger">The logger.</param> /// <param name="codecFactory">The codec factory.</param> public DotNettyUdpServerMessageListener(ILogger <DotNettyUdpServerMessageListener> logger , ITransportMessageCodecFactory codecFactory) { _logger = logger; _transportMessageEncoder = codecFactory.GetEncoder(); _transportMessageDecoder = codecFactory.GetDecoder(); }
public DefaultDotNettyServerMessageListener(ITransportMessageCodecFactory codecFactory, ILogger <DefaultDotNettyServerMessageListener> logger) { _transportMessageEncoder = codecFactory.GetEncoder(); _transportMessageDecoder = codecFactory.GetDecoder(); _logger = logger; }
public ThriftTransportClientFactory(ITransportMessageCodecFactory codecFactory, IHealthCheckService healthCheckService, ILogger <ThriftTransportClientFactory> logger, IServiceExecutor serviceExecutor) { _transportMessageEncoder = codecFactory.GetEncoder(); _transportMessageDecoder = codecFactory.GetDecoder(); _logger = logger; _healthCheckService = healthCheckService; _serviceExecutor = serviceExecutor; }
public DotNettyTransportClientFactory(ITransportMessageCodecFactory codecFactory, ILogger <DotNettyTransportClientFactory> logger, IServiceExecutor serviceExecutor) { _transportMessageEncoder = codecFactory.GetEncoder(); _transportMessageDecoder = codecFactory.GetDecoder(); _logger = logger; _serviceExecutor = serviceExecutor; _bootstrap = GetBootstrap(); }
public DefaultDotNettyServerMessageListener(ITransportMessageCodecFactory codecFactory, ILogger <DefaultDotNettyServerMessageListener> logger) { _transportMessageEncoder = codecFactory.GetEncoder(); _transportMessageDecoder = codecFactory.GetDecoder(); _logger = logger; Console.Write("create transport message for encoder and decoder."); }
public NettyTransportClientFactory(ITransportMessageCodecFactory codecFactory, CommandLineApplication app, IConsole console) { _transportMessageEncoder = codecFactory.GetEncoder(); _transportMessageDecoder = codecFactory.GetDecoder(); _app = app; _console = console; _bootstrap = GetBootstrap(); _bootstrap.Handler(new ActionChannelInitializer <ISocketChannel>(c => { var pipeline = c.Pipeline; pipeline.AddLast(new LengthFieldPrepender(4)); pipeline.AddLast(new LengthFieldBasedFrameDecoder(int.MaxValue, 0, 4, 0, 4)); pipeline.AddLast(new TransportMessageChannelHandlerAdapter(_transportMessageDecoder)); pipeline.AddLast(new DefaultChannelHandler(this)); })); }
public DotNettyTransportClientFactory(ITransportMessageCodecFactory codecFactory, ILogger <DotNettyTransportClientFactory> logger, IServiceExecutor serviceExecutor) { _transportMessageEncoder = codecFactory.GetEncoder(); _transportMessageDecoder = codecFactory.GetDecoder(); _logger = logger; _serviceExecutor = serviceExecutor; _bootstrap = GetBootstrap(); _bootstrap.Handler(new ActionChannelInitializer <ISocketChannel>(c => { var pipeline = c.Pipeline; pipeline.AddLast(new LengthFieldPrepender(4)); pipeline.AddLast(new LengthFieldBasedFrameDecoder(int.MaxValue, 0, 4, 0, 4)); pipeline.AddLast(new TransportMessageChannelHandlerAdapter(_transportMessageDecoder)); pipeline.AddLast(new DefaultChannelHandler(this)); })); }
public DotNettyTransportClientFactory(ITransportMessageCodecFactory codecFactory, ILogger <DotNettyTransportClientFactory> logger, IServiceExecutor serviceExecutor) { _transportMessageEncoder = codecFactory.GetEncoder(); _transportMessageDecoder = codecFactory.GetDecoder(); _logger = logger; _serviceExecutor = serviceExecutor; //_bootstrap = GetBootstrap(); //_bootstrap.Handler(new ActionChannelInitializer<ISocketChannel>(c => //{ // var pipeline = c.Pipeline; // pipeline.AddLast( // new IdleStateHandler(0, 4, 0), // this.idleStateTrigger, // new ProtocolDecoder(), // encoder, // new TransportMessageChannelHandlerAdapter(_transportMessageDecoder), // new DefaultChannelHandler(this)); //})); }
public SimpleClientMessageSender(ITransportMessageEncoder transportMessageEncoder, TcpSocketSaeaClient client) : base(transportMessageEncoder) { _client = client; }
public SimpleClientMessageSender(ITransportMessageEncoder transportMessageEncoder, Func <TcpSocketSaeaClient> clientFactory) : base(transportMessageEncoder) { _clientFactory = clientFactory; }
protected SimpleMessageSender(ITransportMessageEncoder transportMessageEncoder) { _transportMessageEncoder = transportMessageEncoder; }
public SimpleServerMessageSender(ITransportMessageEncoder transportMessageEncoder, TcpSocketSaeaSession session, ILogger logger) : base(transportMessageEncoder) { _session = session; _logger = logger; }
public DefaultTransportMessageCodecFactory() { _encoder = new JsonTransportMessageEncoder(); _decoder = new JsonTransportMessageDecoder(); }
public DotNettyHttpServerMessageSender(ITransportMessageEncoder transportMessageEncoder, IChannelHandlerContext context, ISerializer <string> serializer) : base(transportMessageEncoder) { _context = context; _serializer = serializer; }
public DefaultDotNettyMessageClientSender(ITransportMessageEncoder transportMessageEncoder, IChannel channel) : base(transportMessageEncoder) { _channel = channel; }
public SimpleServerMessageListener(ITransportMessageCodecFactory codecFactory, ILogger <SimpleServerMessageListener> logger) { _transportMessageEncoder = codecFactory.GetEncoder(); _transportMessageDecoder = codecFactory.GetDecoder(); _logger = logger; }
protected ThriftMessageSender(ITransportMessageEncoder transportMessageEncoder) { _transportMessageEncoder = transportMessageEncoder; }
public DotNettyDnsServerMessageSender(ITransportMessageEncoder transportMessageEncoder, IChannelHandlerContext context) : base(transportMessageEncoder) { _context = context; }
public DotNettyMessageClientSender(ITransportMessageEncoder transportMessageEncoder, Task <IChannel> channel) : base(transportMessageEncoder) { _channel = channel; }
public DotNettyServerMessageListener(ILogger<DotNettyServerMessageListener> logger, ITransportMessageCodecFactory codecFactory) { _logger = logger; _transportMessageEncoder = codecFactory.GetEncoder(); _transportMessageDecoder = codecFactory.GetDecoder(); }
public SimpleServerMessageListener(ITransportMessageCodecFactory codecFactory, ILogger<SimpleServerMessageListener> logger) { _transportMessageEncoder = codecFactory.GetEncoder(); _transportMessageDecoder = codecFactory.GetDecoder(); _logger = logger; }
protected DotNettyMessageSender(ITransportMessageEncoder transportMessageEncoder) { _transportMessageEncoder = transportMessageEncoder; }
/// <summary> /// Initializes a new instance of the <see cref="DotNettyUdpMessageSender" /> class. /// </summary> /// <param name="transportMessageEncoder">The transport message encoder.</param> protected DotNettyUdpMessageSender(ITransportMessageEncoder transportMessageEncoder) { _transportMessageEncoder = transportMessageEncoder; }
public DotNettySocketService(IServiceInvoker invoker, ITransportMessageCodecFactory codecFactory, ILogger <DotNettySocketService> logger) { _encoder = codecFactory.CreateEncoder(); _invoker = invoker; _logger = logger; }
public DotNettyMessageClientSender(ITransportMessageEncoder transportMessageEncoder, Task<IChannel> channel) : base(transportMessageEncoder) { _channel = channel; }
public ThriftServerMessageSender(ITransportMessageEncoder transportMessageEncoder, TProtocol context) : base(transportMessageEncoder) { _protocol = context; }
public DotNettyServerMessageSender(ITransportMessageEncoder transportMessageEncoder, IChannelHandlerContext context) : base(transportMessageEncoder) { _context = context; }
protected DefaultDotNettyMessageSender(ITransportMessageEncoder transportMessageEncoder) { _transportMessageEncoder = transportMessageEncoder; }