code: public synchronized OServerAdmin connect(final String iUserName, final String iUserPassword) throws IOException {
      storage.createConnectionPool();
      storage.setSessionId(-1);
  
      try {
        final OChannelBinaryClient network = storage.beginRequest(OChannelBinaryProtocol.REQUEST_CONNECT);
  
        storage.sendClientInfo(network);
  
        try {
          network.writeString(iUserName);
          network.writeString(iUserPassword);
        } finally {
          storage.endRequest(network);
        }
  
        try {
          storage.beginResponse(network);
          sessionId = network.readInt();
          storage.setSessionId(sessionId);
        } finally {
          storage.endResponse(network);
        }
  
      } catch (Exception e) {
        OLogManager.instance().error(this, "Cannot connect to the remote server: " + storage.getName(), e, OStorageException.class);
        storage.close(true);
      }
      return this;
    }
docs: Connects to a remote server.
  
  @param iUserName
  Server's user name
  @param iUserPassword
  Server's password for the user name used
  @return The instance itself. Useful to execute method in chain
  @throws IOException