Exemplo n.º 1
0
void zmq::signaler_t::forked()
{
    //  Close file descriptors created in the parent and create new pair
    close (r);
    close (w);
    make_fdpair (&r, &w);
}
Exemplo n.º 2
0
zmq::signaler_t::signaler_t ()
{
    //  Create the socketpair for signaling.
    int rc = make_fdpair (&r, &w);
    errno_assert (rc == 0);

    //  Set both fds to non-blocking mode.
    unblock_socket (w);
    unblock_socket (r);
}
Exemplo n.º 3
0
zmq::signaler_t::signaler_t ()
{
    //  Create the socketpair for signaling.
    if (make_fdpair (&r, &w) == 0) {
        unblock_socket (w);
        unblock_socket (r);
    }
#ifdef HAVE_FORK
    pid = getpid();
#endif
}
Exemplo n.º 4
0
FREEZE_NET::Signaler::Signaler()
{
    //  Create the socketpair for signaling.
    int rc = make_fdpair(&r_, &w_);
    assert(rc == 0);

    int flags = fcntl(w_, F_GETFL, 0);
    assert(flags >= 0);
    rc = fcntl(w_, F_SETFL, flags | O_NONBLOCK);
    assert(rc == 0);
    flags = fcntl(r_, F_GETFL, 0);
    assert(flags >= 0);
    rc = fcntl(r_, F_SETFL, flags | O_NONBLOCK);
    assert(rc == 0);
}
Exemplo n.º 5
0
int xs::signaler_init (xs::signaler_t *self_)
{
    //  Create the socketpair for signaling.
    int rc = make_fdpair (&self_->r, &self_->w);
    if (rc != 0)
        return -1;

    //  Set both fds to non-blocking mode.
    unblock_socket (self_->w);
    unblock_socket (self_->r);

#if defined XS_USE_SYNC_SELECT
    FD_ZERO (&self_->fds);
#endif

    return 0;
}