code: public void disconnect() {
          if (connection != null && connection.isConnected()) {
              connection.close();
              transaction = null;
              setTransaction(null);
          }
      }
docs: Disconnects this <tt>ModbusTCPMaster</tt> from the slave.