Esempio n. 1
0
int zmq::stream_engine_t::process_handshake_command (msg_t *msg_)
{
    zmq_assert (mechanism != NULL);
    const int rc = mechanism->process_handshake_command (msg_);
    if (rc == 0) {
        if (mechanism->is_handshake_complete ())
            mechanism_ready ();
        if (output_paused)
            activate_out ();
    }

    return rc;
}
Esempio n. 2
0
int zmq::stream_engine_t::next_handshake_command (msg_t *msg_)
{
    zmq_assert (mechanism != NULL);

    const int rc = mechanism->next_handshake_command (msg_);
    if (rc == 0) {
        msg_->set_flags (msg_t::command);
        if (mechanism->is_handshake_complete ())
            mechanism_ready ();
    }

    return rc;
}
Esempio n. 3
0
int zmq::stream_engine_t::next_handshake_message (msg_t *msg_)
{
    zmq_assert (mechanism != NULL);

    const int rc = mechanism->next_handshake_message (msg_);
    if (rc == 0) {
        if (mechanism->is_handshake_complete ())
            mechanism_ready ();
        if (input_paused)
            activate_in ();
    }

    return rc;
}
Esempio n. 4
0
int zmq::stream_engine_t::process_handshake_command (msg_t *msg_)
{
    zmq_assert (mechanism != NULL);
    const int rc = mechanism->process_handshake_command (msg_);
    if (rc == 0) {
        if (mechanism->is_handshake_complete ())
            mechanism_ready ();
        if (output_stopped)
            restart_output ();
    }
    //  TODO:
    //  if (errno == EPROTO || errno == EACCES)
    //      return ERROR command to client

    return rc;
}
Esempio n. 5
0
int zmq::stream_engine_t::next_handshake_command (msg_t *msg_)
{
    zmq_assert (mechanism != NULL);

    const int rc = mechanism->next_handshake_command (msg_);
    if (rc == 0) {
        msg_->set_flags (msg_t::command);
        if (mechanism->is_handshake_complete ())
            mechanism_ready ();
    }
    //  TODO:
    //  if (errno == EPROTO || errno == EACCES)
    //      return ERROR command to client

    return rc;
}
Esempio n. 6
0
int zmq::stream_engine_t::process_handshake_command (msg_t *msg_)
{
    zmq_assert (_mechanism != NULL);
    const int rc = _mechanism->process_handshake_command (msg_);
    if (rc == 0) {
        if (_mechanism->status () == mechanism_t::ready)
            mechanism_ready ();
        else if (_mechanism->status () == mechanism_t::error) {
            errno = EPROTO;
            return -1;
        }
        if (_output_stopped)
            restart_output ();
    }

    return rc;
}
Esempio n. 7
0
int zmq::stream_engine_t::next_handshake_command (msg_t *msg_)
{
    zmq_assert (mechanism != NULL);

    if (mechanism->status () == mechanism_t::ready) {
        mechanism_ready ();
        return pull_and_encode (msg_);
    }
    else
    if (mechanism->status () == mechanism_t::error) {
        errno = EPROTO;
        return -1;
    }
    else {
        const int rc = mechanism->next_handshake_command (msg_);
        if (rc == 0)
            msg_->set_flags (msg_t::command);
        return rc;
    }
}