Install & Compatibility
Where this runs
No compatibility data collected yet for this library.
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
ServerBootstrap
✓ io.netty.bootstrap.ServerBootstrap
Start a Netty server on port 8080
import io.netty.bootstrap.ServerBootstrap;
import io.netty.channel.ChannelInitializer;
import io.netty.channel.nio.NioEventLoopGroup;
import io.netty.channel.socket.nio.NioServerSocketChannel;
import io.netty.channel.socket.SocketChannel;
public class Main {
public static void main(String[] args) throws Exception {
ServerBootstrap bootstrap = new ServerBootstrap();
bootstrap.group(new NioEventLoopGroup())
.channel(NioServerSocketChannel.class)
.childHandler(new ChannelInitializer<SocketChannel>() {
@Override
protected void initChannel(SocketChannel ch) {
ch.pipeline().addLast(new MyHandler());
}
});
bootstrap.bind(8080).sync();
}
}
Debug
Known issues
No known issues recorded.
Upgrade
Version history
4.1.131.Finallatest on Maven
Audit
Dependencies
No dependency data recorded yet.