void
vppcom_disconnect_from_vpp (void)
{
+ vcl_worker_t *wrk = vcl_worker_get_current ();
vppcom_cfg_t *vcl_cfg = &vcm->cfg;
if (vcl_cfg->vpp_api_socket_name)
- vl_socket_client_disconnect ();
+ vl_socket_client_disconnect2 (&wrk->bapi_sock_ctx);
else
vl_client_disconnect_from_vlib ();
}
clib_spinlock_lock (&vcm->workers_lock);
if (notify_vpp)
{
+ /* Notify vpp that the worker is going away */
if (wrk->wrk_index == vcl_get_worker_index ())
vcl_send_app_worker_add_del (0 /* is_add */ );
else
vcl_send_child_worker_del (wrk);
+
+ /* Disconnect the binary api */
+ if (vec_len (vcm->workers) == 1)
+ vppcom_disconnect_from_vpp ();
+ else
+ vl_client_send_disconnect (1 /* vpp should cleanup */ );
}
+
if (wrk->mqs_epfd > 0)
close (wrk->mqs_epfd);
hash_free (wrk->session_index_by_vpp_handles);
vcl_worker_cleanup (vcl_worker_get_current (), 1 /* notify vpp */ );
vcl_set_worker_index (~0);
vcl_elog_stop (vcm);
- if (vec_len (vcm->workers) == 1)
- vppcom_disconnect_from_vpp ();
- else
- vl_client_send_disconnect (1 /* vpp should cleanup */ );
}
/*
u8
vl_mem_client_is_connected (void)
{
- return (memory_client_main.connected_to_vlib != 0);
+ return (my_memory_client_main->connected_to_vlib != 0);
}
static int