pbms_connect
Description
PBMS pbms_connect ( const char* host ,unsigned int port ,const char* database)
Establishes a connection to a PBMS BLOB streaming daemon running on host. pbms_connect() must complete successfully before you can execute any other API functions that require a valid PBMS connection handle structure.

Internal connections to the PBMS daemon are only opened as needed and are closed after each access unless the PBMS_OPTION_KEEP_ALIVE is set to true. Even then the connection will only remain open for as long as the daemon's max_keep_alive setting allows.

The first time a new connection is opened the PBMS BLOB streaming daemon will be pinged to verify that all the connection parameters, with the exception of database, are good.

Parameters
host
The hostname or an IP address.
port
The TCP/IP port number of the PBMS BLOB streaming server.
database
The database to associate with this connection.
Return Values

On success A PBMS connection handle is returned.

On failure NULL is returned. Use pbms_errno() and pbms_error() to retrieve error details passing NULL for pbms.

Example
 
	PBMS pbms;
	pbms = pbms_connect("localhost", 8080, "A_database");
	if (!pbms) {
		printf("Connection failed (%d): %s\n", 
			pbms_errno(NULL), 
			pbms_errno(NULL)
		);
		return;
	}
	
	/* 
	 * Do something here.....
	 */
	
	pbms_close(pbms);

		
Related functions
pbms_close()