[Freeswitch-svn] [commit] r10298 - freeswitch/trunk/src/mod/event_handlers/mod_event_socket
FreeSWITCH SVN
anthm at freeswitch.org
Fri Nov 7 15:25:38 PST 2008
Author: anthm
Date: Fri Nov 7 18:25:38 2008
New Revision: 10298
Modified:
freeswitch/trunk/src/mod/event_handlers/mod_event_socket/mod_event_socket.c
Log:
move bind to load func
Modified: freeswitch/trunk/src/mod/event_handlers/mod_event_socket/mod_event_socket.c
==============================================================================
--- freeswitch/trunk/src/mod/event_handlers/mod_event_socket/mod_event_socket.c (original)
+++ freeswitch/trunk/src/mod/event_handlers/mod_event_socket/mod_event_socket.c Fri Nov 7 18:25:38 2008
@@ -756,6 +756,13 @@
switch_mutex_init(&globals.listener_mutex, SWITCH_MUTEX_NESTED, pool);
+ if (switch_event_bind_removable(modname, SWITCH_EVENT_ALL, SWITCH_EVENT_SUBCLASS_ANY, event_handler, NULL, &globals.node) != SWITCH_STATUS_SUCCESS) {
+ switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Couldn't bind!\n");
+ return SWITCH_STATUS_GENERR;
+ }
+
+ switch_log_bind_logger(socket_logger, SWITCH_LOG_DEBUG, SWITCH_FALSE);
+
/* connect my internal structure to the blank pointer passed to me */
*module_interface = switch_loadable_module_create_module_interface(pool, modname);
SWITCH_ADD_APP(app_interface, "socket", "Connect to a socket", "Connect to a socket", socket_function, "<ip>[:<port>]", SAF_SUPPORT_NOMEDIA);
@@ -1901,13 +1908,6 @@
listen_list.ready = 1;
- if (switch_event_bind_removable(modname, SWITCH_EVENT_ALL, SWITCH_EVENT_SUBCLASS_ANY, event_handler, NULL, &globals.node) != SWITCH_STATUS_SUCCESS) {
- switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Couldn't bind!\n");
- return SWITCH_STATUS_GENERR;
- }
-
- switch_log_bind_logger(socket_logger, SWITCH_LOG_DEBUG, SWITCH_FALSE);
-
for (;;) {
if (switch_core_new_memory_pool(&listener_pool) != SWITCH_STATUS_SUCCESS) {
More information about the Freeswitch-svn
mailing list