Client should be able to select the thread mode.
If the use_thread = 1, the com-core will fork a new thread for getting the packet from the socket.
So the socket buffer always be empty.
Change-Id: I7a83f4de807dd5d7310d66dd46684887636189ef
* limitations under the License.
*/
-extern int client_init(void);
+extern int client_init(int use_thread);
extern int client_fd(void);
extern const char *client_addr(void);
extern int client_fini(void);
* \pre N/A
* \post N/A
* \see livebox_fini
+ * \see livebox_init_with_options
*/
extern int livebox_init(void *disp);
* \param[in] disp
* \param[in] prevent_overwrite
* \param[in] event_filter
+ * \param[in] use_thread Use the receive thread
* \return int
* \retval LB_STATUS_SUCCESS if success
* \pre N/A
* \see livebox_init
* \see livebox_fini
*/
-extern int livebox_init_with_options(void *disp, int prevent_overwrite, double event_filter);
+extern int livebox_init_with_options(void *disp, int prevent_overwrite, double event_filter, int use_thread);
/*!
* \brief Finalize the livebox system
* \pre N/A
* \post N/A
* \see livebox_init
+ * \see livebox_init_with_options
*/
extern int livebox_fini(void);
Name: liblivebox-viewer
-Summary: Library for developing the application.
-Version: 0.18.0
+Summary: Library for developing the application
+Version: 0.18.1
Release: 1
Group: HomeTF/Livebox
License: Flora
return 0;
}
-int client_init(void)
+int client_init(int use_thread)
{
+ com_core_packet_use_thread(use_thread);
+
s_info.client_addr = vconf_get_str(VCONFKEY_MASTER_CLIENT_ADDR);
if (!s_info.client_addr) {
s_info.client_addr = strdup(CLIENT_SOCKET);
return master_rpc_request_only(handler, packet);
}
-static void initialize_livebox(void *disp)
+static void initialize_livebox(void *disp, int use_thread)
{
#if defined(FLOG)
char filename[BUFSIZ];
livebox_service_init();
fb_init(disp);
- client_init();
+ client_init(use_thread);
s_info.init_count++;
}
-EAPI int livebox_init_with_options(void *disp, int prevent_overwrite, double event_filter)
+EAPI int livebox_init_with_options(void *disp, int prevent_overwrite, double event_filter, int use_thread)
{
if (s_info.init_count > 0) {
s_info.init_count++;
s_info.prevent_overwrite = prevent_overwrite;
MINIMUM_EVENT = event_filter;
- initialize_livebox(disp);
+ initialize_livebox(disp, use_thread);
return LB_STATUS_SUCCESS;
}
sscanf(env, "%lf", &MINIMUM_EVENT);
}
- initialize_livebox(disp);
+ initialize_livebox(disp, 0);
return LB_STATUS_SUCCESS;
}