summaryrefslogtreecommitdiff
path: root/src/pgm_sender.cpp
diff options
context:
space:
mode:
authorMartin Sustrik <sustrik@250bpm.com>2011-07-24 18:25:30 +0200
committerMartin Sustrik <sustrik@250bpm.com>2011-07-24 18:25:30 +0200
commit7c1dca546d9e49e7af372e4fff9e6a87058a7f12 (patch)
treef00c6760dcd14b944457928405e7e2eca23b1ff8 /src/pgm_sender.cpp
parentf716b571baf59c1b622c7666bb8bf2905126a3d4 (diff)
Session classes merged into a single class
Removal of ZMQ_IDENTITY resulted in various session classes doing almost the same thing. This patch merges the classes into a single class. Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
Diffstat (limited to 'src/pgm_sender.cpp')
-rw-r--r--src/pgm_sender.cpp11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/pgm_sender.cpp b/src/pgm_sender.cpp
index 9b1e215..d2419ea 100644
--- a/src/pgm_sender.cpp
+++ b/src/pgm_sender.cpp
@@ -30,6 +30,7 @@
#include "io_thread.hpp"
#include "pgm_sender.hpp"
+#include "session.hpp"
#include "err.hpp"
#include "wire.hpp"
#include "stdint.hpp"
@@ -61,7 +62,7 @@ int zmq::pgm_sender_t::init (bool udp_encapsulation_, const char *network_)
return rc;
}
-void zmq::pgm_sender_t::plug (io_thread_t *io_thread_, i_engine_sink *sink_)
+void zmq::pgm_sender_t::plug (io_thread_t *io_thread_, session_t *session_)
{
// Alocate 2 fds for PGM socket.
int downlink_socket_fd = 0;
@@ -69,7 +70,7 @@ void zmq::pgm_sender_t::plug (io_thread_t *io_thread_, i_engine_sink *sink_)
int rdata_notify_fd = 0;
int pending_notify_fd = 0;
- encoder.set_sink (sink_);
+ encoder.set_session (session_);
// Fill fds from PGM transport and add them to the poller.
pgm_socket.get_sender_fds (&downlink_socket_fd, &uplink_socket_fd,
@@ -94,9 +95,9 @@ void zmq::pgm_sender_t::plug (io_thread_t *io_thread_, i_engine_sink *sink_)
// subscribe for all the messages.
msg_t msg;
msg.init ();
- bool ok = sink_->write (&msg);
+ bool ok = session_->write (&msg);
zmq_assert (ok);
- sink_->flush ();
+ session_->flush ();
}
void zmq::pgm_sender_t::unplug ()
@@ -115,7 +116,7 @@ void zmq::pgm_sender_t::unplug ()
rm_fd (uplink_handle);
rm_fd (rdata_notify_handle);
rm_fd (pending_notify_handle);
- encoder.set_sink (NULL);
+ encoder.set_session (NULL);
}
void zmq::pgm_sender_t::terminate ()