Bonjour,

Je réalise actuellement une architecture client-serveur à l'aide de Netty. J'ai un serveur Netty mais je n'arrive pas à comprendre comment récupérer le channel créé par le serveur pour télécharger un fichier. Le client est soit en Netty soit en Java, j'enquête sur les deux pistes.
Merci pour votre réponse.
Voici le code de mon serveur:
public void start() throws Exception {
final SslContext sslCtx;

sslCtx = null;

bossGroup = new NioEventLoopGroup(1);
workerGroup = new NioEventLoopGroup();
ServerBootstrap boot = new ServerBootstrap();
boot.group(bossGroup, workerGroup);
boot.channel(NioServerSocketChannel.class);
boot.childHandler(new NettyServerInitializer(sslCtx));
chan = boot.bind(new InetSocketAddress("127.0.0.1",port)).sync().channel();
// System.out.println(chan.toString());

}

/**
* Method to stop the server.
*
* @throws Exception if an exception occurs.
*/
public void stop() throws Exception {
chan.closeFuture().sync();
bossGroup.shutdownGracefully();
workerGroup.shutdownGracefully();
}

/**
* Method to launch the server.
*
* @param args: no args.
*/
public static void main(String... args) {
try {
new NettyServer().start();
if (LOGGER.isDebugEnabled()) {
LOGGER.debug("API started on port {}", port);
}
} catch (final Exception e) {
LOGGER.error("Unable to start API server", e);
}
}