Hi All,
I'm trying to use ubus to deliver cmd to my program and ask program to exit.
Please check following code.
void videod_ubus::ubus_reply_okay(struct ubus_request_data *req)
{
blob_buf_init(&blob, 0);
blobmsg_add_string(&blob, "reply", "okay");
ubus_send_reply(ctx, req, blob.head);
ubus_complete_deferred_request(ctx, req, 0);
}
int videod_exit(struct ubus_context *ctx, struct ubus_object *obj,
struct ubus_request_data *req, const char *method,
struct blob_attr *msg)
{
if (videod_instance) {
videod_instance->ubus_reply_okay(req);
videod_instance->set_exit(true);
uloop_end();
}
return 0;
}
When program receive "exit" method, "videod_exit" will be called. At that moment, I try to reply "okay" and cancel uloop to exit program.
But sometimes, the client(ubus call vidoed exit) will be blocked for timeout.
What should I do to fix timeout issue? Thanks.