All TCP Server implementations with Netty 4.0 I have found use a ServerBootstrap instance.
The biggest and only difference between a server and a client in Netty is that different Bootstrap and Channel implementations are used. Please take a look at the following code:
netty docu talking about a TCP Client.
But for UDP this quote seems irrelevant?! I found examples for UDP Servers that use just Bootstrap like: 1, 2, 3
I am pretty confused by that, so my two questions are:
- Is the Bootstrap class a correct entry point to implement a UDP Server? or may I use ServerBootstrap for it?
- Why is there a NioServerSocketChannel.class and NioSocketChannel.class for TCP, but only one NioDatagramChannel.class (and no NioServerDatagramChannel.class) for UDP?
For Netty 3.x there was the ConnectionlessBootstrap shown here but for 4.0 I couldn't find something similar.