in c/src/messenger/messenger.c [1266:1334]
int pn_messenger_process_events(pn_messenger_t *messenger)
{
int processed = 0;
pn_event_t *event;
while ((event = pn_collector_peek(messenger->collector))) {
processed++;
switch (pn_event_type(event)) {
case PN_CONNECTION_INIT:
pn_logf("connection created: %p", (void *) pn_event_connection(event));
break;
case PN_SESSION_INIT:
pn_logf("session created: %p", (void *) pn_event_session(event));
break;
case PN_LINK_INIT:
pn_logf("link created: %p", (void *) pn_event_link(event));
break;
case PN_CONNECTION_REMOTE_OPEN:
case PN_CONNECTION_REMOTE_CLOSE:
case PN_CONNECTION_LOCAL_OPEN:
case PN_CONNECTION_LOCAL_CLOSE:
pn_messenger_process_connection(messenger, event);
break;
case PN_SESSION_REMOTE_OPEN:
case PN_SESSION_REMOTE_CLOSE:
case PN_SESSION_LOCAL_OPEN:
case PN_SESSION_LOCAL_CLOSE:
pn_messenger_process_session(messenger, event);
break;
case PN_LINK_REMOTE_OPEN:
case PN_LINK_REMOTE_CLOSE:
case PN_LINK_REMOTE_DETACH:
case PN_LINK_LOCAL_OPEN:
case PN_LINK_LOCAL_CLOSE:
case PN_LINK_LOCAL_DETACH:
pn_messenger_process_link(messenger, event);
break;
case PN_LINK_FLOW:
pn_messenger_process_flow(messenger, event);
break;
case PN_DELIVERY:
pn_messenger_process_delivery(messenger, event);
break;
case PN_TRANSPORT:
case PN_TRANSPORT_ERROR:
case PN_TRANSPORT_HEAD_CLOSED:
case PN_TRANSPORT_TAIL_CLOSED:
case PN_TRANSPORT_CLOSED:
pn_messenger_process_transport(messenger, event);
break;
case PN_EVENT_NONE:
break;
case PN_CONNECTION_BOUND:
break;
case PN_CONNECTION_UNBOUND:
break;
case PN_CONNECTION_FINAL:
break;
case PN_SESSION_FINAL:
break;
case PN_LINK_FINAL:
break;
default:
break;
}
pn_collector_pop(messenger->collector);
}
return processed;
}