+static void tr_trps_process_mq(int socket, short event, void *arg)
+{
+ TRPS_INSTANCE *trps=talloc_get_type_abort(arg, TRPS_INSTANCE);
+ TR_MQ_MSG *msg=NULL;
+
+ tr_debug("tr_trps_process_mw: starting");
+ msg=trps_mq_pop(trps);
+ while (msg!=NULL) {
+ tr_debug("tr_trps_process_mq: received message");
+ tr_mq_msg_free(msg);
+ msg=trps_mq_pop(trps);
+ }
+ tr_debug("tr_trps_process_mw: ending");
+}
+
+TR_TRPS_EVENTS *tr_trps_events_new(TALLOC_CTX *mem_ctx)
+{
+ TR_TRPS_EVENTS *ev=talloc(mem_ctx, TR_TRPS_EVENTS);
+ if (ev!=NULL) {
+ ev->listen_ev=talloc(ev, struct tr_socket_event);
+ ev->mq_ev=NULL;
+ if (ev->listen_ev==NULL) {
+ talloc_free(ev);
+ ev=NULL;
+ }
+ }
+ return ev;
+}