code: protected Command executeSendCommand(SendCommandTask task, long timeout)
              throws PDUException, ResponseTimeoutException,
              InvalidResponseException, NegativeResponseException, IOException {
  
          int seqNum = sequence.nextValue();
          PendingResponse<Command> pendingResp = new PendingResponse<Command>(timeout);
          pendingResponse.put(seqNum, pendingResp);
          try {
              task.executeTask(connection().getOutputStream(), seqNum);
          } catch (IOException e) {
              logger.error("Failed sending " + task.getCommandName() + " command", e);
  
              if("enquire_link".equals(task.getCommandName())) {
                  logger.info("Tomas: Ignore failure of sending enquire_link, wait to see if connection is restored");
              } else {
                  pendingResponse.remove(seqNum);
                  close();
                  throw e;
              }
          }
  
          try {
              pendingResp.waitDone();
              logger.debug("{} response with sequence {} received for session {}", task.getCommandName(), seqNum, sessionId);
          } catch (ResponseTimeoutException e) {
              pendingResponse.remove(seqNum);
              throw new ResponseTimeoutException("No response after waiting for "
                      + timeout + " millis when executing "
                      + task.getCommandName() + " with sessionId " + sessionId
                      + " and sequenceNumber " + seqNum, e);
          } catch (InvalidResponseException e) {
              pendingResponse.remove(seqNum);
              throw e;
          }
  
          Command resp = pendingResp.getResponse();
          validateResponse(resp);
          return resp;
      }
docs: Execute send command command task.
  
  @param task is the task.
  @param timeout is the timeout in millisecond.
  @return the command response.
  @throws PDUException if there is invalid PDU parameter found.
  @throws ResponseTimeoutException if the response has reach it timeout.
  @throws InvalidResponseException if invalid response found.
  @throws NegativeResponseException if the negative response found.
  @throws IOException if there is an IO error found.