[svn r258] Added gmyth_query and gmyth_scheduler connection methods with timeout. Besides, configura.ac now checks libmysqlclient in the right way
1 #include <glib-object.h>
4 #include "gmyth_backendinfo.h"
5 #include "gmyth_socket.h"
6 #include "gmyth_query.h"
9 test_backend_connection1 (GMythBackendInfo *backend_info)
11 GMythSocket *socket = gmyth_socket_new ();
12 if (gmyth_socket_connect (socket,
13 gmyth_backend_info_get_hostname (backend_info),
14 gmyth_backend_info_get_port (backend_info)) == TRUE) {
15 g_debug ("Connection success");
18 g_debug ("Connection failed");
24 test_mysql_connection1 (GMythBackendInfo *backend_info)
26 GMythQuery *query = gmyth_query_new ();
28 if (gmyth_query_connect_with_timeout (query, backend_info, 3) == TRUE) {
29 g_debug ("Mysql connection success");
32 g_debug ("Mysql connection failed");
40 main (int args, const char **argv)
42 const char* uri = argv[1];
44 GMythBackendInfo *backend_info;
48 backend_info = gmyth_backend_info_new_with_uri (argv[1]);
50 test_mysql_connection1 (backend_info);
51 test_backend_connection1 (backend_info);