Commit 976b347d authored by legoc's avatar legoc
Browse files

Removed cancelCreatePublisher() from ContextZmq

parent 005ecca8
......@@ -90,12 +90,4 @@ zmq::socket_t * ContextZmq::createOutputStreamSubscriber(const std::string& endp
return subscriber;
}
zmq::socket_t * ContextZmq::createCancelPublisher(const std::string& endpoint) {
zmq::socket_t * publisher = new zmq::socket_t(*m_context.get(), ZMQ_PUB);
publisher->bind(endpoint.c_str());
return publisher;
}
}
......@@ -44,7 +44,6 @@ public:
zmq::socket_t * createEventSubscriber(const std::string& endpoint, const std::string& cancelEndpoint);
zmq::socket_t * createOutputStreamSubscriber(const std::string& endpoint, const std::string& cancelEndpoint);
zmq::socket_t * createCancelPublisher(const std::string& endpoint);
private:
std::unique_ptr<zmq::context_t> m_context;
......
......@@ -41,7 +41,10 @@ void EventStreamSocketZmq::init() {
cancelEndpoint << "inproc://cancel." << CancelIdGenerator::newId();
// Create the sockets.
m_cancelSocket.reset(m_context->createCancelPublisher(cancelEndpoint.str()));
m_cancelSocket = std::unique_ptr<zmq::socket_t>(new zmq::socket_t(m_context->getContext(), ZMQ_PUB));
m_cancelSocket->bind(cancelEndpoint.str());
m_socket.reset(m_context->createEventSubscriber(m_server->getStatusEndpoint().toString(), cancelEndpoint.str()));
// Wait for the connection to be ready.
......
......@@ -48,7 +48,9 @@ void OutputStreamSocketZmq::init() {
cancelEndpoint << "inproc://cancel." << CancelIdGenerator::newId();
// Create the sockets.
m_cancelSocket.reset(m_context->createCancelPublisher(cancelEndpoint.str()));
m_cancelSocket = std::unique_ptr<zmq::socket_t>(new zmq::socket_t(m_context->getContext(), ZMQ_PUB));
m_cancelSocket->bind(cancelEndpoint.str());
m_socket.reset(m_context->createOutputStreamSubscriber(m_server->getEndpoint().withPort(port).toString(), cancelEndpoint.str()));
// Wait for the connection to be ready.
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment