listener object unregisters its fd correctly

This commit is contained in:
Martin Sustrik 2010-08-24 09:57:15 +02:00
parent 0d5f3ebbda
commit 87655b0b9d
3 changed files with 3 additions and 7 deletions

View File

@ -62,15 +62,12 @@ void zmq::zmq_engine_t::plug (io_thread_t *io_thread_, i_inout *inout_)
// Connect to I/O threads poller object.
io_object_t::plug (io_thread_);
handle = add_fd (tcp_socket.get_fd ());
set_pollin (handle);
set_pollout (handle);
// Flush all the data that may have been already received downstream.
in_event ();
// TODO: Re-plug to the new I/O thread & poller!
}
void zmq::zmq_engine_t::unplug ()

View File

@ -49,9 +49,10 @@ void zmq::zmq_listener_t::process_plug ()
set_pollin (handle);
}
void zmq::zmq_listener_t::process_unplug ()
void zmq::zmq_listener_t::process_term ()
{
rm_fd (handle);
own_t::process_term ();
}
void zmq::zmq_listener_t::in_event ()
@ -70,5 +71,3 @@ void zmq::zmq_listener_t::in_event ()
launch_sibling (init);
}

View File

@ -44,7 +44,7 @@ namespace zmq
// Handlers for incoming commands.
void process_plug ();
void process_unplug ();
void process_term ();
// Handlers for I/O events.
void in_event ();