static int nn_xpair_events (struct nn_sockbase *self) { struct nn_xpair *xpair; int events; xpair = nn_cont (self, struct nn_xpair, sockbase); events = 0; if (nn_excl_can_recv (&xpair->excl)) events |= NN_SOCKBASE_EVENT_IN; if (nn_excl_can_send (&xpair->excl)) events |= NN_SOCKBASE_EVENT_OUT; return events; }
int nn_xrespondent_events (struct nn_sockbase *self) { struct nn_xrespondent *xrespondent; int events; xrespondent = nn_cont (self, struct nn_xrespondent, sockbase); events = 0; if (nn_excl_can_recv (&xrespondent->excl)) events |= NN_SOCKBASE_EVENT_IN; if (nn_excl_can_send (&xrespondent->excl)) events |= NN_SOCKBASE_EVENT_OUT; return events; }