@Override
  public void handleMessage(CoapMessage message) {
    /* message MUST be a request */
    if (message.isEmpty()) {
      return;
    }

    if (!message.isRequest()) {
      return;
      // throw new IllegalStateException("Incomming server message is not a request");
    }

    BasicCoapRequest request = (BasicCoapRequest) message;
    CoapChannel channel = request.getChannel();
    /* TODO make this cast safe */
    server.onRequest((CoapServerChannel) channel, request);
  }
 /*TODO: implement */
 public void lostConnection(boolean notReachable, boolean resetByServer) {
   server.onSeparateResponseFailed(this);
 }