title: Netty UDP Server Bootstrap
body: <p>All TCP Server implementations with Netty 4.0 I have found use a ServerBootstrap instance.</p>
  
  <blockquote>
    <p>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:</p>
  </blockquote>
  
  <p><a href="http://netty.io/wiki/user-guide-for-4.x.html#writing-a-time-client" rel="nofollow noreferrer">netty docu</a> talking about a TCP Client.</p>
  
  <hr>
  
  <p>But for UDP this quote seems irrelevant?! I found examples for UDP Servers that use just Bootstrap like: <a href="https://stackoverflow.com/questions/23914397/udp-server-using-springnetty">1</a>, <a href="https://stackoverflow.com/questions/34455466/multi-threaded-udp-server-with-netty">2</a>, <a href="https://stackoverflow.com/questions/29406262/netty-udp-handlers-asynchronous">3</a></p>
  
  <p>I am pretty confused by that, so my two <strong>questions</strong> are:</p>
  
  <ul>
  <li><strong>Is the Bootstrap class a correct entry point to implement a UDP Server?</strong> or may I use ServerBootstrap for it?</li>
  <li><strong>Why is there a NioServerSocketChannel.class and NioSocketChannel.class for TCP, but only one NioDatagramChannel.class (and no NioServerDatagramChannel.class) for UDP?</strong></li>
  </ul>
  
  <hr>
  
  <p>For Netty 3.x there was the ConnectionlessBootstrap shown <a href="https://github.com/normanmaurer/javamagazin-netty-ws/blob/master/src/main/java/me/normanmaurer/javamagazin/netty/examples/ws/WebSocketServer.java" rel="nofollow noreferrer">here</a> but for 4.0 I couldn't find something similar.</p>