Skip to content

Commit

Permalink
Add m_contoller for iopub_client
Browse files Browse the repository at this point in the history
  • Loading branch information
anutosh491 committed Mar 21, 2024
1 parent 2544d77 commit 16e7136
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/xdealer_channel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand All @@ -35,7 +35,7 @@ namespace xeus
std::optional<zmq::multipart_t> 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<int>(timeout));
if (wire_msg.recv(m_socket))
{
return wire_msg;
Expand Down
5 changes: 4 additions & 1 deletion src/xiopub_client.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,18 @@
#include "xclient_zmq_impl.hpp"

#include "xeus-zmq/xzmq_serializer.hpp"
#include "xeus-zmq/xmiddleware.hpp"

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()
Expand Down
1 change: 1 addition & 0 deletions src/xiopub_client.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ namespace xeus

private:
zmq::socket_t m_iopub;
zmq::socket_t m_controller;

std::queue<xmessage> m_message_queue;
mutable std::mutex m_queue_mutex;
Expand Down

0 comments on commit 16e7136

Please sign in to comment.