Set of reusable Netty components.
<dependency>
<groupId>net.dryuf</groupId>
<artifactId>dryuf-netty</artifactId>
<version>1.0.2</version>
</dependency>
try (NettyEngine engine = new NettyEngine()) {
CompletableFuture<ServerChannel> server1 = engine.listen(AddressSpec.builder()
.family(AddressSpec.AF_TCP4)
.host("*")
.port(8090)
.build()
);
CompletableFuture<ServerChannel> server2 = engine.listen(AddressSpec.builder()
.family(AddressSpec.AF_TCP4)
.host("*")
.port(8091)
.build()
);
server1.get();
server2.get();
for (;;) {
Thread.sleep(Long.MAX_VALUE, TimeUnit.SECONDS);
}
}
The code is released under version 2.0 of the Apache License.
Feel free to contact me at [email protected] and http://github.com/kvr000/ and http://github.com/dryuf/ and https://www.linkedin.com/in/zbynek-vyskovsky/