code: public void disconnect() throws Exception {
  
          if (connection != null) {
              try {
                  if (connection instanceof Closeable) {
                      ((Closeable) connection).close();
                  } else {
                      try {
                          connection.getInputStream().close();
                      } catch (IOException e) {
                          // ignore
                      }
  
                      try {
                          connection.getOutputStream().close();
                      } catch (IOException e) {
                          // ignore
                      }
                  }
              } finally {
                  connection = null;
              }
          }
      }
docs: Discoonects from the k3po server.
  @throws Exception if error in closing the connection.