2 * Copyright (c) 2011-2015 Samsung Electronics Co., Ltd All Rights Reserved
4 * Licensed under the Apache License, Version 2.0 (the License);
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an AS IS BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
20 #include "vcd_server.h"
22 #define CLIENT_CLEAN_UP_TIME 500
24 static Ecore_Timer* g_check_client_timer = NULL;
26 int main(int argc, char** argv)
28 SLOG(LOG_DEBUG, TAG_VCD, " ");
29 SLOG(LOG_DEBUG, TAG_VCD, " ");
30 SLOG(LOG_DEBUG, TAG_VCD, "===== VC Daemon Initialize");
33 SLOG(LOG_ERROR, TAG_VCD, "[ERROR] Fail ecore_init()");
37 if (0 != vcd_dbus_open_connection()) {
38 SLOG(LOG_ERROR, TAG_VCD, "[ERROR] Fail to open connection");
42 if (0 != vcd_initialize()) {
43 SLOG(LOG_ERROR, TAG_VCD, "[ERROR] Fail to initialize vc-daemon");
47 g_check_client_timer = ecore_timer_add(CLIENT_CLEAN_UP_TIME, vcd_cleanup_client_all, NULL);
48 if (NULL == g_check_client_timer) {
49 SLOG(LOG_WARN, TAG_VCD, "[Main Warning] Fail to create timer of client check");
52 SLOG(LOG_DEBUG, TAG_VCD, "[Main] vc-daemon start...");
54 SLOG(LOG_DEBUG, TAG_VCD, "=====");
55 SLOG(LOG_DEBUG, TAG_VCD, " ");
56 SLOG(LOG_DEBUG, TAG_VCD, " ");
58 ecore_main_loop_begin();
60 SLOG(LOG_DEBUG, TAG_VCD, "===== VC Daemon Finalize");
62 if (NULL != g_check_client_timer) {
63 ecore_timer_del(g_check_client_timer);
68 vcd_dbus_close_connection();
72 SLOG(LOG_DEBUG, TAG_VCD, "=====");
73 SLOG(LOG_DEBUG, TAG_VCD, " ");
74 SLOG(LOG_DEBUG, TAG_VCD, " ");