Documentation Home
MySQL NDB Cluster API Developer Guide
Download this Manual Ndb_cluster_connection::connect()

Description.  This method connects to a cluster management server.


int connect
      int retries = 30,
      int delay   = 1,
      int verbose = 0

Parameters.  This method takes three parameters, all of which are optional:

  • retries specifies the number of times to retry the connection in the event of failure. The default value is 30.

    0 means that no additional attempts to connect are made in the event of failure; using a negative value for retries results in the connection attempt being repeated indefinitely.

  • The delay represents the number of seconds between reconnect attempts; the default is 1 second.

  • verbose indicates whether the method should output a report of its progress, with 1 causing this reporting to be enabled; the default is 0 (reporting disabled).

Return value.  This method returns an int, which can have one of the following 3 values:

  • 0: The connection attempt was successful.

  • 1: Indicates a recoverable error.

  • -1: Indicates an unrecoverable error.