/** Structure for referencing files. */
typedef apr_file_t switch_file_t;
+#define SWITCH_SO_LINGER APR_SO_LINGER
+#define SWITCH_SO_KEEPALIVE APR_SO_KEEPALIVE
+#define SWITCH_SO_DEBUG APR_SO_DEBUG
+#define SWITCH_SO_NONBLOCK APR_SO_NONBLOCK
+#define SWITCH_SO_REUSEADDR APR_SO_REUSEADDR
+#define SWITCH_SO_SNDBUF APR_SO_SNDBUF
+#define SWITCH_SO_RCVBUF APR_SO_RCVBUF
+#define SWITCH_SO_DISCONNECTED APR_SO_DISCONNECTED
+
/**
* @defgroup switch_file_permissions File Permissions flags
* @ingroup switch_file_io
static const char modname[] = "mod_event_test";
+//#define TORTURE_ME
+
+
static void event_handler(switch_event *event)
{
char buf[1024];
}
+
static switch_loadable_module_interface event_test_module_interface = {
/*.module_name */ modname,
/*.endpoint_interface */ NULL,
#define MY_EVENT_COOL "test::cool"
-//#define TORTURE_ME
-
#ifdef TORTURE_ME
#define TTHREADS 500
static int THREADS = 0;
switch_console_printf(SWITCH_CHANNEL_CONSOLE, "Couldn't register subclass!");
return SWITCH_STATUS_GENERR;
}
-#ifdef TORTURE_ME
+
if (switch_event_bind((char *) modname, SWITCH_EVENT_ALL, SWITCH_EVENT_SUBCLASS_ANY, event_handler, NULL) !=
SWITCH_STATUS_SUCCESS) {
switch_console_printf(SWITCH_CHANNEL_CONSOLE, "Couldn't bind!\n");
return SWITCH_STATUS_GENERR;
}
+#ifdef TORTURE_ME
if (1) {
int x = 0;
for (x = 0; x < TTHREADS; x++) {