Netty connecting to multiple servers
Some issues with your code

The biggest is that you are creating a
new ArrayList with each interruption of your server.  You probably
want to allocate that array outside the loop that is creating the clients and then add each future to that look as they are created.

I'd avoid the &quot;sync&quot; in the for loop waiting for things to
get done.  If you need to wait for them to complete, attache a
promise listener to each of the futures with a little lambda
function to do whatever it is you need done when the clients are
finished.

I'd pass shutdown gracefully a time limit rather than just
waiting forever.


Without more of your code, its hard to say what else you have
overlooked.