From 16e7136ac4f51ae7bb867dee75219036aa1f5173 Mon Sep 17 00:00:00 2001 From: anutosh491 Date: Thu, 21 Mar 2024 15:20:55 +0530 Subject: [PATCH] Add m_contoller for iopub_client --- src/xdealer_channel.cpp | 4 ++-- src/xiopub_client.cpp | 5 ++++- src/xiopub_client.hpp | 1 + 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/src/xdealer_channel.cpp b/src/xdealer_channel.cpp index b77b52f..81c986c 100644 --- a/src/xdealer_channel.cpp +++ b/src/xdealer_channel.cpp @@ -20,7 +20,7 @@ namespace xeus const std::string& port) : m_socket(context, zmq::socket_type::dealer) { - m_socket.connect(xeus::get_end_point(transport, ip, port)); + m_socket.connect(get_end_point(transport, ip, port)); } xdealer_channel::~xdealer_channel() @@ -35,7 +35,7 @@ namespace xeus std::optional xdealer_channel::receive_message(long timeout) { zmq::multipart_t wire_msg; - m_socket.set(zmq::sockopt::linger, timeout); + m_socket.set(zmq::sockopt::linger, static_cast(timeout)); if (wire_msg.recv(m_socket)) { return wire_msg; diff --git a/src/xiopub_client.cpp b/src/xiopub_client.cpp index 5c01f2a..3519766 100644 --- a/src/xiopub_client.cpp +++ b/src/xiopub_client.cpp @@ -13,6 +13,7 @@ #include "xclient_zmq_impl.hpp" #include "xeus-zmq/xzmq_serializer.hpp" +#include "xeus-zmq/xmiddleware.hpp" namespace xeus { @@ -20,8 +21,10 @@ namespace xeus xiopub_client::xiopub_client(zmq::context_t& context, const xeus::xconfiguration& config) : m_iopub(context, zmq::socket_type::sub) + , m_controller(context, zmq::socket_type::rep) { - m_iopub.connect(xeus::get_end_point(config.m_transport, config.m_ip, config.m_iopub_port)); + m_iopub.connect(get_end_point(config.m_transport, config.m_ip, config.m_iopub_port)); + init_socket(m_controller, get_controller_end_point("iopub")); } xiopub_client::~xiopub_client() diff --git a/src/xiopub_client.hpp b/src/xiopub_client.hpp index 8d9ed73..f374e76 100644 --- a/src/xiopub_client.hpp +++ b/src/xiopub_client.hpp @@ -43,6 +43,7 @@ namespace xeus private: zmq::socket_t m_iopub; + zmq::socket_t m_controller; std::queue m_message_queue; mutable std::mutex m_queue_mutex;