code: public void eventSunk(final ChannelPipeline pipeline, final ChannelEvent e)
              throws Exception {
          final NioDatagramChannel channel = (NioDatagramChannel) e.getChannel();
          final ChannelFuture future = e.getFuture();
          if (e instanceof ChannelStateEvent) {
              final ChannelStateEvent stateEvent = (ChannelStateEvent) e;
              final ChannelState state = stateEvent.getState();
              final Object value = stateEvent.getValue();
              switch (state) {
                  case OPEN:
                      if (Boolean.FALSE.equals(value)) {
                          channel.worker.close(channel, future);
                      }
                      break;
                  case BOUND:
                      if (value != null) {
                          bind(channel, future, (InetSocketAddress) value);
                      } else {
                          channel.worker.close(channel, future);
                      }
                      break;
                  case CONNECTED:
                      if (value != null) {
                          connect(channel, future, (InetSocketAddress) value);
                      } else {
                          NioServerDatagramBoss.disconnect(channel, future);
                      }
                      break;
                  case INTEREST_OPS:
                      channel.worker.setInterestOps(channel, future, ((Integer) value).intValue());
                      break;
              }
          } else if (e instanceof MessageEvent) {
              final MessageEvent event = (MessageEvent) e;
              final boolean offered = channel.writeBufferQueue.offer(event);
              assert offered;
              channel.worker.writeFromUserCode(channel);
          }
      }
docs: Handle downstream event.
  
  @param pipeline the {@link ChannelPipeline} that passes down the
  downstream event.
  @param e The downstream event.