private void bind ( Bootstrap bootstrap , Iterator < String > ifaces , int port , CompletableFuture < Void > future ) { if ( ifaces . hasNext ( ) ) { String iface = ifaces . next ( ) ; bootstrap . bind ( iface , port ) . addListener ( ( ChannelFutureListener ) f -> { if ( f . isSuccess ( ) ) { log . info ( "UDP server listening for connections on {}:{}" , iface , port ) ; channel = ( DatagramChannel ) f . channel ( ) ; bind ( bootstrap , ifaces , port , future ) ; } else { log . warn ( "Failed to bind TCP server to port {}:{} due to {}" , iface , port , f . cause ( ) ) ; future . completeExceptionally ( f . cause ( ) ) ; } } ) ; } else { future . complete ( null ) ; } }
Recursively binds the given bootstrap to the given interfaces .