1 #include "opensrf/osrf_system.h"
4 int osrf_system_bootstrap_client() {
6 transport_client* client = client_init( "judy", 5222, 0 );
9 char* host = getenv("HOSTNAME");
10 sprintf(buf, "client_%s_%d", host, getpid() );
12 if(client_connect( client, "who","hello_you", buf, 10, AUTH_DIGEST )) {
13 /* push ourselves into the client cache */
14 osrf_system_push_transport_client( client, "client" );
21 // -----------------------------------------------------------------------------
22 // Some client caching utility methods
23 transport_client_cache* client_cache;
25 void osrf_system_push_transport_client( transport_client* client, char* service ) {
26 if(client == NULL || service == NULL) return;
27 transport_client_cache* new = (transport_client_cache*) safe_malloc(sizeof(transport_client_cache));
28 new->service = strdup(service);
30 if(client_cache == NULL)
33 transport_client_cache* tmp = client_cache->next;
39 transport_client* osrf_system_get_transport_client( char* service ) {
40 if(service == NULL) return NULL;
41 transport_client_cache* cur = client_cache;
43 if( !strcmp(cur->service, service))
49 // -----------------------------------------------------------------------------