code: public void writeData(final NextFilter nextFilter, final IoSession session,
              final WriteRequest writeRequest, final boolean isHandshakeData) {
          ProxyLogicHandler handler = getProxyHandler(session);
  
          synchronized (handler) {
              if (handler.isHandshakeComplete()) {
                  // Handshake is done - write data as normal
                  nextFilter.filterWrite(session, writeRequest);
              } else if (isHandshakeData) {
                  LOGGER.debug("   handshake data: {}", writeRequest.getMessage());
                  
                  // Writing handshake data
                  nextFilter.filterWrite(session, writeRequest);
              } else {
                  // Writing non-handshake data before the handshake finished
                  if (!session.isConnected()) {
                      // Not even connected - ignore
                      LOGGER.debug(" Write request on closed session. Request ignored.");
                  } else {
                      // Queue the data to be sent as soon as the handshake completes
                      LOGGER.debug(" Handshaking is not complete yet. Buffering write request.");
                      handler.enqueueWriteRequest(nextFilter, writeRequest);
                  }
              }
          }
      }
docs: Actually write data. Queues the data up unless it relates to the handshake or the
  handshake is done.
  
  @param nextFilter the next filter in filter chain
  @param session the session object
  @param writeRequest the data to write
  @param isHandshakeData true if writeRequest is written by the proxy classes.