code: public void sendHandshakeResponse(HandshakeResponse wsResponse) {
          log.debug("Writing handshake on session: {}", session.getId());
          // create write future
          handshakeWriteFuture = session.write(wsResponse);
          handshakeWriteFuture.addListener(new IoFutureListener<WriteFuture>() {
  
              @Override
              public void operationComplete(WriteFuture future) {
                  IoSession sess = future.getSession();
                  if (future.isWritten()) {
                      // handshake is finished
                      log.debug("Handshake write success! {}", sess.getId());
                      // set completed flag
                      sess.setAttribute(Constants.HANDSHAKE_COMPLETE);
                      // set connected state on ws connection
                      if (connected.compareAndSet(false, true)) {
                          try {
                              // send queued packets
                              queue.forEach(entry -> {
                                  sess.write(entry);
                                  queue.remove(entry);
                              });
                          } catch (Exception e) {
                              log.warn("Exception draining queued packets on session: {}", sess.getId(), e);
                          }
                      }
                  } else {
                      log.warn("Handshake write failed from: {} to: {}", sess.getLocalAddress(), sess.getRemoteAddress());
                  }
              }
  
          });
      }
docs: Sends the handshake response.
  
  @param wsResponse