0

I would like to build a TCP server based on Netty and configure the host and port dynamically. How do I achieve this? It seems like an abstract class, I tried to extend it. But I have no no idea how to implement a dynamic address

below is my code snippet:

public class DynamicAddressHandler extends DynamicAddressConnectHandler {

    private InetSocketAddress address;


    public DynamicAddressHandler() {
        DynamicAddressConnectHandler dynamicAddressConnectHandler = new DynamicAddressConnectHandler();
    }

    @Override
    public void bind(ChannelHandlerContext ctx, SocketAddress localAddress, ChannelPromise promise) throws Exception {
        super.bind(ctx, localAddress, promise);
    }

    @Override
    public void disconnect(ChannelHandlerContext ctx, ChannelPromise promise) throws Exception {
        super.disconnect(ctx, promise);
    }
}
kerbermeister
  • 2,985
  • 3
  • 11
  • 30
Peng
  • 653
  • 8

0 Answers0