Rename engine's methods to improve code readability

This commit is contained in:
Martin Hurton
2013-09-26 09:37:04 +02:00
parent 63e0fe915e
commit b35c08beb4
8 changed files with 33 additions and 33 deletions

View File

@@ -74,8 +74,8 @@ zmq::stream_engine_t::stream_engine_t (fd_t fd_, const options_t &options_,
io_error (false),
subscription_required (false),
mechanism (NULL),
input_paused (false),
output_paused (false),
input_stopped (false),
output_stopped (false),
socket (NULL)
{
int rc = tx_msg.init ();
@@ -204,7 +204,7 @@ void zmq::stream_engine_t::in_event ()
zmq_assert (decoder);
// If there has been an I/O error, stop polling.
if (input_paused) {
if (input_stopped) {
rm_fd (handle);
io_error = true;
return;
@@ -252,7 +252,7 @@ void zmq::stream_engine_t::in_event ()
error ();
return;
}
input_paused = true;
input_stopped = true;
reset_pollin (handle);
}
@@ -291,7 +291,7 @@ void zmq::stream_engine_t::out_event ()
// If there is no data to send, stop polling for output.
if (outsize == 0) {
output_paused = true;
output_stopped = true;
reset_pollout (handle);
return;
}
@@ -328,14 +328,14 @@ void zmq::stream_engine_t::out_event ()
terminate ();
}
void zmq::stream_engine_t::activate_out ()
void zmq::stream_engine_t::restart_output ()
{
if (unlikely (io_error))
return;
if (likely (output_paused)) {
if (likely (output_stopped)) {
set_pollout (handle);
output_paused = false;
output_stopped = false;
}
// Speculative write: The assumption is that at the moment new message
@@ -345,9 +345,9 @@ void zmq::stream_engine_t::activate_out ()
out_event ();
}
void zmq::stream_engine_t::activate_in ()
void zmq::stream_engine_t::restart_input ()
{
zmq_assert (input_paused);
zmq_assert (input_stopped);
zmq_assert (session != NULL);
zmq_assert (decoder != NULL);
@@ -379,7 +379,7 @@ void zmq::stream_engine_t::activate_in ()
if (rc == -1 || io_error)
error ();
else {
input_paused = false;
input_stopped = false;
set_pollin (handle);
session->flush ();
@@ -614,8 +614,8 @@ int zmq::stream_engine_t::process_handshake_command (msg_t *msg_)
if (rc == 0) {
if (mechanism->is_handshake_complete ())
mechanism_ready ();
if (output_paused)
activate_out ();
if (output_stopped)
restart_output ();
}
return rc;
@@ -630,10 +630,10 @@ void zmq::stream_engine_t::zap_msg_available ()
error ();
return;
}
if (input_paused)
activate_in ();
if (output_paused)
activate_out ();
if (input_stopped)
restart_input ();
if (output_stopped)
restart_output ();
}
void zmq::stream_engine_t::mechanism_ready ()