user5396668
user5396668

Reputation: 145

Modifying netty channel options on the fly

In my netty application I bootstrap a server channel with EpollChannelOption.TCP_MD5SIG and supply a map of IP-key:

        Map<InetAddress, byte[]> md5keys = …..//set initial peer-ips and keys

        ServerBootstrap b = new ServerBootstrap();
        b.group(bossGroup, workerGroup)
         .channel(EpollServerSocketChannel.class)
         .handler(new LoggingHandler(LogLevel.INFO))
         .childHandler(new MyServerInitializer());
        b.childOption(ChannelOption.SO_KEEPALIVE, true);
        b.childOption(ChannelOption.TCP_NODELAY, true);
        b.option(EpollChannelOption.TCP_MD5SIG, md5keys);

Is it possible to change the md5keys map (to add a new ip for example) after the channel is already active and serving clients without disrupting the communication with these clients?

Upvotes: 0

Views: 241

Answers (1)

Norman Maurer
Norman Maurer

Reputation: 23557

Sure you can use channel.config().setOption(...).

Upvotes: 2

Related Questions