beautypg.com

Initializing the library to use a remote database – Grass Valley K2 TX/MAM Database Protocol Manual v.2.2 User Manual

Page 7

background image

TX/MAM Database Protocol Manual - document version: 2.2

– Page 7

5.2 Initializing the library to use a remote database

Use this function to verify if a remote database can be accessed.

int cob_init_remote( char *database_ip, int port );



Parameters

Name

Description

char *database_ip

The ip-address of the machine with the remote database, e.g. "192.168.7.186".

int port

The port on the remote machine to connect to, default 5020.



Result
The result of the function is an integer that can have following values:

Value

Description

0

Success, the library can now be used to retrieve information from the
remote database.

-1

Failure, setting up a connection to the remote database failed.



Example

if ( cob_init_remote("192.168.7.186",5020) == 0 ) {

/* continue with the rest of the applet */

} else {

/* not possible to connect to database, report error and stop... */

return -1;

}