00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00021
00022
00073 #include <string.h>
00074 #include <signal.h>
00075 #include <sys/types.h>
00076 #include <isc/eventlib.h>
00077 #include <jnx/mpsdk.h>
00078 #include <jnx/aux_types.h>
00079 #include "hellopics-data_conn.h"
00080
00081
00082
00086 #define DNAME_HELLOPICS_DATA "hellopics-data"
00087
00088
00089
00090
00091
00092
00093
00097 static void
00098 hellopics_data_quit(int signo __unused)
00099 {
00100 close_connections();
00101 msp_exit();
00102 }
00103
00104
00113 static int
00114 hellopics_data_init (evContext ctx)
00115 {
00116 msp_init();
00117
00118
00119 msp_sig_register(SIGTERM, hellopics_data_quit);
00120 signal(SIGHUP, SIG_IGN);
00121 signal(SIGPIPE, SIG_IGN);
00122
00123 return init_connections(ctx);
00124 }
00125
00126
00127
00128
00129
00142 int
00143 main(int32_t argc , char **argv)
00144 {
00145 mp_sdk_app_ctx_t app_ctx;
00146 int rc;
00147
00148 app_ctx = msp_create_app_ctx(argc, argv, DNAME_HELLOPICS_DATA);
00149 msp_set_app_cb_init(app_ctx, hellopics_data_init);
00150
00151 rc = msp_app_init(app_ctx);
00152
00153
00154 msp_destroy_app_ctx(app_ctx);
00155 return rc;
00156 }
00157