Exemplo n.º 1
0
        public virtual void Start()
        {
            _eventLoopGroup = new NioEventLoopGroup();
            ServerBootstrap bootstrap = (new ServerBootstrap()).group(_eventLoopGroup).channel(typeof(NioServerSocketChannel)).option(ChannelOption.SO_REUSEADDR, true).localAddress(0).childHandler(new ChannelInitializerAnonymousInnerClass(this));

            _channel = bootstrap.bind().syncUninterruptibly().channel();
        }
Exemplo n.º 2
0
//JAVA TO C# CONVERTER WARNING: 'final' parameters are ignored unless the option to convert to C# 7.2 'in' parameters is selected:
//ORIGINAL LINE: void start(final ApplicationProtocolRepository applicationProtocolRepository, final ModifierProtocolRepository modifierProtocolRepository)
            internal virtual void Start(ApplicationProtocolRepository applicationProtocolRepository, ModifierProtocolRepository modifierProtocolRepository)
            {
                EventLoopGroup = new NioEventLoopGroup();
                ServerBootstrap bootstrap = (new ServerBootstrap()).group(EventLoopGroup).channel(typeof(NioServerSocketChannel)).option(ChannelOption.SO_REUSEADDR, true).localAddress(0).childHandler(new ChannelInitializerAnonymousInnerClass(this, applicationProtocolRepository, modifierProtocolRepository));

                Channel = bootstrap.bind().syncUninterruptibly().channel();
            }
Exemplo n.º 3
0
//JAVA TO C# CONVERTER WARNING: 'final' parameters are ignored unless the option to convert to C# 7.2 'in' parameters is selected:
//ORIGINAL LINE: void start(final ApplicationProtocolRepository applicationProtocolRepository, final ModifierProtocolRepository modifierProtocolRepository, org.neo4j.logging.LogProvider logProvider)
            internal virtual void Start(ApplicationProtocolRepository applicationProtocolRepository, ModifierProtocolRepository modifierProtocolRepository, LogProvider logProvider)
            {
                RaftProtocolServerInstallerV2.Factory raftFactoryV2 = new RaftProtocolServerInstallerV2.Factory(nettyHandler, PipelineBuilderFactory, logProvider);
                RaftProtocolServerInstallerV1.Factory raftFactoryV1 = new RaftProtocolServerInstallerV1.Factory(nettyHandler, PipelineBuilderFactory, logProvider);
                ProtocolInstallerRepository <Org.Neo4j.causalclustering.protocol.ProtocolInstaller_Orientation_Server> protocolInstallerRepository = new ProtocolInstallerRepository <Org.Neo4j.causalclustering.protocol.ProtocolInstaller_Orientation_Server>(Arrays.asList(raftFactoryV1, raftFactoryV2), Org.Neo4j.causalclustering.protocol.ModifierProtocolInstaller_Fields.AllServerInstallers);

                EventLoopGroup = new NioEventLoopGroup();
                ServerBootstrap bootstrap = (new ServerBootstrap()).group(EventLoopGroup).channel(typeof(NioServerSocketChannel)).option(ChannelOption.SO_REUSEADDR, true).localAddress(PortAuthority.allocatePort()).childHandler((new HandshakeServerInitializer(applicationProtocolRepository, modifierProtocolRepository, protocolInstallerRepository, PipelineBuilderFactory, logProvider)).asChannelInitializer());

                Channel = bootstrap.bind().syncUninterruptibly().channel();
            }
Exemplo n.º 4
0
            internal Client(ApplicationProtocolRepository applicationProtocolRepository, ModifierProtocolRepository modifierProtocolRepository, NettyPipelineBuilderFactory pipelineBuilderFactory, Config config, LogProvider logProvider)
            {
                RaftProtocolClientInstallerV2.Factory raftFactoryV2 = new RaftProtocolClientInstallerV2.Factory(pipelineBuilderFactory, logProvider);
                RaftProtocolClientInstallerV1.Factory raftFactoryV1 = new RaftProtocolClientInstallerV1.Factory(pipelineBuilderFactory, logProvider);
                ProtocolInstallerRepository <Org.Neo4j.causalclustering.protocol.ProtocolInstaller_Orientation_Client> protocolInstallerRepository = new ProtocolInstallerRepository <Org.Neo4j.causalclustering.protocol.ProtocolInstaller_Orientation_Client>(Arrays.asList(raftFactoryV1, raftFactoryV2), Org.Neo4j.causalclustering.protocol.ModifierProtocolInstaller_Fields.AllClientInstallers);

                EventLoopGroup = new NioEventLoopGroup();
                Duration handshakeTimeout = config.Get(CausalClusteringSettings.handshake_timeout);

                HandshakeClientInitializer = new HandshakeClientInitializer(applicationProtocolRepository, modifierProtocolRepository, protocolInstallerRepository, pipelineBuilderFactory, handshakeTimeout, logProvider, logProvider);
                Bootstrap = (new Bootstrap()).group(EventLoopGroup).channel(typeof(NioSocketChannel)).handler(HandshakeClientInitializer);
            }
Exemplo n.º 5
0
        public override void Start()
        {
            lock (this)
            {
                _serviceLock.writeLock().@lock();
                try
                {
                    _eventLoopGroup = new NioEventLoopGroup(0, new NamedThreadFactory("sender-service"));
                    _bootstrap      = (new Bootstrap()).group(_eventLoopGroup).channel(typeof(NioSocketChannel)).handler(_channelInitializer);

                    _senderServiceRunning = true;
                }
                finally
                {
                    _serviceLock.writeLock().unlock();
                }
            }
        }
Exemplo n.º 6
0
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
//ORIGINAL LINE: public SecureClient(SslPolicy sslPolicy) throws javax.net.ssl.SSLException
        public SecureClient(SslPolicy sslPolicy)
        {
            _eventLoopGroup = new NioEventLoopGroup();
            _bootstrap      = (new Bootstrap()).group(_eventLoopGroup).channel(typeof(NioSocketChannel)).handler(new ClientInitializer(this, sslPolicy, _bucket));
        }
Exemplo n.º 7
0
 internal Client(HandshakeClient handshakeClient)
 {
     EventLoopGroup = new NioEventLoopGroup();
     Bootstrap      = (new Bootstrap()).group(EventLoopGroup).channel(typeof(NioSocketChannel)).handler(new ClientInitializer(handshakeClient));
 }