示例#1
0
        public async Task Start(IPAddress ip_address, int port,
                                string orleansClientConfigFile, SessionHandlerFactory 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);
        }
示例#2
0
 public GatewayChannelHandler(SessionHandlerFactory factory)
 {
     this.factory = factory;
 }
示例#3
0
 public Task Start(IPAddress ip_address, int port,
                   string orleansClientConfigFile, SessionHandlerFactory factory)
 {
     return(this.gatewayRunner.Start(ip_address, port, orleansClientConfigFile, factory));
 }