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.
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.
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);