mirror of
https://github.com/zeromq/libzmq.git
synced 2025-10-17 03:03:25 +02:00
Fix issue #370
The patch extends the internal session's API with the reset method. This method is used to reset a session's state so that it can handle a new connection.
This commit is contained in:
@@ -190,6 +190,13 @@ int zmq::session_base_t::write (msg_t *msg_)
|
||||
return -1;
|
||||
}
|
||||
|
||||
void zmq::session_base_t::reset ()
|
||||
{
|
||||
// Restore identity flags.
|
||||
send_identity = options.send_identity;
|
||||
recv_identity = options.recv_identity;
|
||||
}
|
||||
|
||||
void zmq::session_base_t::flush ()
|
||||
{
|
||||
if (pipe)
|
||||
@@ -388,9 +395,7 @@ void zmq::session_base_t::detached ()
|
||||
return;
|
||||
}
|
||||
|
||||
// Restore identity flags.
|
||||
send_identity = options.send_identity;
|
||||
recv_identity = options.recv_identity;
|
||||
reset ();
|
||||
|
||||
// Reconnect.
|
||||
if (options.reconnect_ivl != -1)
|
||||
|
Reference in New Issue
Block a user