code: @Override
      public synchronized boolean checkConnection(final boolean forceReconnect) {
          if (checkConnection(conn)) {
              return true;
          } else if (forceReconnect) {
              try {
                  connect();
                  recover();
  
                  return true;
              } catch (final Exception ex) {
                  logger.debug(dev, "reconnection failure", ex);
                  return false;
              }
          }
  
          return false;
      }
docs: Checks if the connection is alive.
  
  @param forceReconnect True to force the connection in case of failure.
  @return True if the connection is valid, false otherwise.