#include <dlfcn.h>
#include <service_app.h>
#include <glib.h>
+#include <Ecore.h>
#include "service.h"
#include "nlp_log.h"
#include "message.h"
+int sec = 60.0;
+static Ecore_Timer *service_close_timer = NULL;
+
struct client_s {
char *id;
rpc_port_message_notify_cb_h cb;
return handle;
}
+static Eina_Bool timer_cb(void *data)
+{
+ PLOG("time runs out");
+ service_close_timer = NULL;
+ service_app_exit();
+ return ECORE_CALLBACK_CANCEL;
+}
+
+void start_timer()
+{
+ stop_timer();
+ service_close_timer = ecore_timer_add(sec,timer_cb,NULL);
+ if (service_close_timer == NULL)
+ PLOG("failed to create timer");
+}
+
+void stop_timer()
+{
+ if (service_close_timer != NULL) {
+ ecore_timer_del(service_close_timer);
+ service_close_timer = NULL;
+ }
+}
+
static void __destroy_client(gpointer data)
{
PENTER();
static int __message_send(rpc_port_stub_message_context_h context,
const bundle *msg, void *user_data)
{
+ stop_timer();
struct client_s *sender_client = NULL;
char *message = NULL;
bundle_add_str(reply, "request_id", request_id);
rpc_port_message_notify_cb_invoke(sender_client->cb, sender_client->id, reply);
bundle_free(reply);
+ start_timer();
return 0;
}
PINFO("nltk stem library loaded success: ");
globe_lang = nltk_get_module("langdetect");
PINFO("langdetect library loaded success: ");
+ start_timer();
int ret;
rpc_port_stub_message_callback_s callback = {
void service_app_control(app_control_h app_control, void *data)
{
// Todo: add your code here.
+ PINFO("service_app_control");
return;
}