//--------------------------------------------------------------------- public async Task Start(IPAddress ip_address, int port, string orleansClientConfigFile, GatewaySessionFactory factory) { bootstrap .Group(bossGroup, workerGroup) .Channel<TcpServerSocketChannel>() .Option(ChannelOption.SoBacklog, 100) .Handler(new LoggingHandler(LogLevel.INFO)) .ChildHandler(new ActionChannelInitializer<ISocketChannel>(channel => { IChannelPipeline pipeline = channel.Pipeline; pipeline.AddLast(new LengthFieldPrepender( ByteOrder.LittleEndian, 2, 0, false)); pipeline.AddLast(new LengthFieldBasedFrameDecoder( ByteOrder.LittleEndian, ushort.MaxValue, 0, 2, 0, 2, true)); pipeline.AddLast(new GatewayChannelHandler(factory)); })); bootstrapChannel = await bootstrap.BindAsync(ip_address, port); GrainClient.Initialize(orleansClientConfigFile); }
//--------------------------------------------------------------------- public GatewayChannelHandler(GatewaySessionFactory factory) { this.factory = factory; }