code: protected Promise<Integer> sendCallArray(Object[] req) {
          final Promise<Integer> p = new Promise<>();
          if (SENDDEBUG)
              System.out.println("SENDING "+(req.length-1));
          for (int i = 0; i < req.length; i++) {
              Object o = req[i];
              if ( o instanceof RemoteCallEntry ) {
                  ((RemoteCallEntry) o).pack(conf);
              }
          }
          byte[] message = conf.asByteArray(req);
          HttpPost request = createRequest(sessionUrl, message);
          if ( DumpProtocol ) {
              try {
                  System.out.println("req:"+new String(message,"UTF-8"));
              } catch (UnsupportedEncodingException e) {
                  e.printStackTrace();
              }
          }
          getClient().execute(request, new FutureCallback<HttpResponse>() {
              @Override
              public void completed(HttpResponse result) {
                  if (result.getStatusLine().getStatusCode() != 200) {
                      String error = "Unexpected status:" + result.getStatusLine().getStatusCode();
                      p.reject(error);
                      return;
                  }
                  lastPing = System.currentTimeMillis();
                  String cl = result.getFirstHeader("Content-Length").getValue();
                  int len = Integer.parseInt(cl);
                  if (len > 0) {
                      final byte b[] = new byte[len];
                      try {
                          result.getEntity().getContent().read(b);
                          myExec.execute(new Runnable() {
                              @Override
                              public void run() {
                                  int numMsgResp = 0;
                                  try {
                                      numMsgResp = processResponse(b);
                                  } finally {
                                      p.complete(numMsgResp,null);
                                  }
                              }
                          });
                      } catch (Throwable e) {
                          p.complete(null,e);
                          log(e);
                      }
                  } else {
                      p.complete(0,null);
                  }
              }
  
              @Override
              public void failed(Exception ex) {
                  p.complete(null,ex);
                  log(ex);
              }
  
              @Override
              public void cancelled() {
                  p.complete(0,null);
                  log("request canceled");
              }
          });
          return p;
      }
docs: encodes amd semds (incl seqNo). needs be executed inside lock (see calls of this)