RemoteSqlEngine:open( parameter list )

Open the SQL engine with a list of parameters.

Prototype

 
    bool open(char const* hostname, int port, 
            int maxConnectAttempts = 10, 
            bool localDomain = false, 
            void* sslParameters = NULL,
            timer_unit connectTimeout = 2*1000, 
            timer_unit readTimeout = 1200*1000, 
            int compressionLevel = 0);
 

Arguments

hostname The name of the host where the server is located
port The server port
maxConnectAttempts The maximum number of attempts to connect to the server
localDomain Indicates that Unix Domain Socket instead of networked TCP socket is used for RSQL communication which is possible only when server and client are on the same host
sslParameters A pointer to a mco_ssl_params_t structure containing SSL connection settings
connectTimeout The timeout for each connect attempt in milliseconds; so the total connection time can be up to connectTimeout * maxConnectionAttempts milliseconds
readTimeout The timeout for read operations in milliseconds
compression_level The level of compression: 0 = no compression; 1 = best speed, 9 - best compression. Default value is 0

Description

This method opens an eXtremeDB database, an eXtremeDB SQL mapper and the McoSqlEngine instance with the list of parameters specified.

Returns

This method returns true if the connection to the server was successfully established, false otherwise.

Example

     
    const int SERVER_PORT = 5001;
    char const* SERVER_HOST = "localhost";
     
    int main(int argc, char* argv[])
    {
        MCO_RET rc;
        McoSqlEngine engine;
         
        ...
        engine.open( SERVER_HOST, SERVER_PORT );
            
        ...
    }