}
-static void expire_listener(listener_t ** listener)
-{
- void *pop;
-
- switch_thread_rwlock_unlock((*listener)->rwlock);
- switch_core_hash_destroy(&(*listener)->event_hash);
- switch_core_destroy_memory_pool(&(*listener)->pool);
-
- while (switch_queue_trypop((*listener)->event_queue, &pop) == SWITCH_STATUS_SUCCESS) {
- switch_event_t *pevent = (switch_event_t *) pop;
- switch_event_destroy(&pevent);
- }
-
- *listener = NULL;
-}
-
-
static void remove_binding(listener_t *listener, erlang_pid * pid)
{
struct erlang_binding *ptr, *lst = NULL;
continue;
}
- if (switch_test_flag(l, LFLAG_STATEFUL) && l->timeout && switch_epoch_time_now(NULL) - l->last_flush > l->timeout) {
- switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, "Stateful Listener %u has expired\n", l->id);
- remove_listener(l);
- expire_listener(&l);
- continue;
- }
-
if (l->event_list[SWITCH_EVENT_ALL]) {
send = 1;
} else if ((l->event_list[event->event_id])) {
switch_hash_t *sessions;
int lost_events;
int lost_logs;
- time_t last_flush;
- uint32_t timeout;
uint32_t id;
char remote_ip[50];
/*switch_port_t remote_port; */
switch_event_node_t *node;
switch_mutex_t *ref_mutex;
switch_mutex_t *fetch_reply_mutex;
+ switch_mutex_t *listener_count_mutex;
switch_hash_t *fetch_reply_hash;
unsigned int reference0;
unsigned int reference1;