broker_t * broker_new (const char *contexts_uri, const char *executors_uri) { broker_t *self = (broker_t *) malloc (sizeof (broker_t)); assert (self); printf ("[BROKER] binding to frontend %s\n", contexts_uri); self->contexts = zsock_new_router (contexts_uri); assert(self->contexts); printf ("[BROKER] binding to backend %s\n", executors_uri); self->executors = zsock_new_router (executors_uri); assert (self->executors); zsock_set_router_mandatory (self->executors, true); // Only poll on executors until we have executors available. self->poller = zpoller_new (self->executors, NULL); assert (self->poller); self->executor_lb = zlist_new (); assert (self->executor_lb); self->backlog = zlist_new (); assert (self->backlog); return self; }
/// // Set socket option `router_mandatory`. void QZsock::setRouterMandatory (int routerMandatory) { zsock_set_router_mandatory (self, routerMandatory); }
JNIEXPORT void JNICALL Java_org_zeromq_czmq_Zsock__1_1setRouterMandatory (JNIEnv *env, jclass c, jlong self, jint router_mandatory) { zsock_set_router_mandatory ((zsock_t *) (intptr_t) self, (int) router_mandatory); }