예제 #1
0
파일: xpair.c 프로젝트: 4ker/nanomsg
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;
}
예제 #2
0
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;
}