Commit 06a99027 authored by Anmol Vatsa's avatar Anmol Vatsa

Abort controller if can't open rpc server

parent 24f94d1c
......@@ -5,6 +5,7 @@
#include "mul_vty.h"
#include "controller.h"
#include "controller_rpc_server.h"
#include "controller_rpc_client.h"
/* Global Opts */
struct cnc_opts cnc_opts = {
......@@ -65,10 +66,12 @@ void cnc_module_init(void *base_arg) {
cn_init();
if( (intercomm_rpc_server_init(cnc_opts.rpc_iface_addr)) < 0) {
return;
c_log_err("ERROR: Could not instantiate Intercomm server. Abort.");
exit(1);
}
if ( (intercomm_rpc_server_register(cnc_opts.rpc_iface_addr, cnc_opts.registry_service_addr, &my_controller_id)) < 0) {
return;
c_log_err("ERROR: Could not register Intercomm server at controller registry. Abort.");
exit(1);
}
GHashTable *clients = intercomm_rpc_clients_init(cnc_opts.registry_service_addr);
if (!clients) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment