code: public void send(final ComposableBody body) throws BOSHException {
          assertUnlocked();
          if (body == null) {
              throw(new IllegalArgumentException(
                      "Message body may not be null"));
          }
  
          HTTPExchange exch;
          CMSessionParams params;
          lock.lock();
          try {
              blockUntilSendable(body);
              if (!isWorking() && !isTermination(body)) {
                  throw(new BOSHException(
                          "Cannot send message when session is closed"));
              }
              
              long rid = requestIDSeq.getNextRID();
              ComposableBody request = body;
              params = cmParams;
              if (params == null && exchanges.isEmpty()) {
                  // This is the first message being sent
                  request = applySessionCreationRequest(rid, body);
              } else {
                  request = applySessionData(rid, body);
                  if (cmParams.isAckingRequests()) {
                      pendingRequestAcks.add(request);
                  }
              }
              exch = new HTTPExchange(request);
              exchanges.add(exch);
              notEmpty.signal();
              clearEmptyRequest();
          } finally {
              lock.unlock();
          }
          AbstractBody finalReq = exch.getRequest();
          HTTPResponse resp = httpSender.send(params, finalReq);
          exch.setHTTPResponse(resp);
          fireRequestSent(finalReq);
      }
docs: Send the provided message data to the remote connection manager.  The
  provided message body does not need to have any BOSH-specific attribute
  information set.  It only needs to contain the actual message payload
  that should be delivered to the remote server.
  <p>
  The first call to this method will result in a connection attempt
  to the remote connection manager.  Subsequent calls to this method
  will block until the underlying session state allows for the message
  to be transmitted.  In certain scenarios - such as when the maximum
  number of outbound connections has been reached - calls to this method
  will block for short periods of time.
  </p>
  
  @param body message data to send to remote server
  @throws BOSHException on message transmission failure