code: public void close() {
          if (connected) {
              try {
                  transport.close();
                  socket.close();
              }
              catch (IOException ex) {
                  logger.warn("Could not close socket", ex);
              }
              connected = false;
          }
      }
docs: Closes this <tt>TCPSlaveConnection</tt>.