code: protected void sendMessage (UpstreamMessage msg)
          throws IOException
      {
          if (debugLogMessages()) {
              log.info("SEND " + msg);
          }
  
          // first we write the message so that we can measure it's length
          _oout.writeObject(msg);
          _oout.flush();
  
          // then write the framed message to actual output stream
          try {
              ByteBuffer buffer = _fout.frameAndReturnBuffer();
              if (buffer.limit() > 4096) {
                  String txt = StringUtil.truncate(String.valueOf(msg), 80, "...");
                  log.info("Whoa, writin' a big one", "msg", txt, "size", buffer.limit());
              }
              int wrote = writeMessage(buffer);
              if (wrote != buffer.limit()) {
                  log.warning("Aiya! Couldn't write entire message", "msg", msg,
                              "size", buffer.limit(), "wrote", wrote);
              } else {
  //                 Log.info("Wrote " + wrote + " bytes.");
                  _client.getMessageTracker().messageSent(false, wrote, msg);
              }
  
          } finally {
              _fout.resetFrame();
          }
  
          // make a note of our most recent write time
          updateWriteStamp();
      }
docs: Writes the supplied message to the socket.