Skip to content

Commit

Permalink
addressed some reviews
Browse files Browse the repository at this point in the history
  • Loading branch information
anutosh491 committed Mar 21, 2024
1 parent c3c14ff commit 2544d77
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 17 deletions.
4 changes: 2 additions & 2 deletions src/xclient_zmq_impl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ namespace xeus
const xeus::xconfiguration& config,
nl::json::error_handler_t eh)
: p_auth(make_xauthentication(config.m_signature_scheme, config.m_key))
, m_shell_client(context, config)
, m_control_client(context, config)
, m_shell_client(context, config.m_transport, config.m_ip, config.m_shell_port)
, m_control_client(context, config.m_transport, config.m_ip, config.m_control_port)
, m_iopub_client(context, config)
, p_messenger(context)
, m_error_handler(eh)
Expand Down
10 changes: 4 additions & 6 deletions src/xdealer_channel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,18 +15,16 @@ namespace xeus
{

xdealer_channel::xdealer_channel(zmq::context_t& context,
const xeus::xconfiguration& config)
const std::string& transport,
const std::string& ip,
const std::string& port)
: m_socket(context, zmq::socket_type::dealer)
, m_end_point("")
{
m_end_point = xeus::get_end_point(config.m_transport, config.m_ip, config.m_shell_port);

m_socket.connect(m_end_point);
m_socket.connect(xeus::get_end_point(transport, ip, port));
}

xdealer_channel::~xdealer_channel()
{
m_socket.disconnect(m_end_point);
}

void xdealer_channel::send_message(zmq::multipart_t& message)
Expand Down
6 changes: 3 additions & 3 deletions src/xdealer_channel.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,9 @@ namespace xeus
public:

xdealer_channel(zmq::context_t& context,
const xeus::xconfiguration& config);
const std::string& transport,
const std::string& ip,
const std::string& port);

~xdealer_channel();

Expand All @@ -34,9 +36,7 @@ namespace xeus
zmq::socket_t& get_socket();

private:

zmq::socket_t m_socket;
std::string m_end_point;
};
}

Expand Down
6 changes: 1 addition & 5 deletions src/xiopub_client.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,16 +20,12 @@ namespace xeus
xiopub_client::xiopub_client(zmq::context_t& context,
const xeus::xconfiguration& config)
: m_iopub(context, zmq::socket_type::sub)
, m_iopub_end_point("")
{
m_iopub_end_point = xeus::get_end_point(config.m_transport, config.m_ip, config.m_iopub_port);

m_iopub.connect(m_iopub_end_point);
m_iopub.connect(xeus::get_end_point(config.m_transport, config.m_ip, config.m_iopub_port));
}

xiopub_client::~xiopub_client()
{
m_iopub.disconnect(m_iopub_end_point);
}

std::size_t xiopub_client::iopub_queue_size() const
Expand Down
1 change: 0 additions & 1 deletion src/xiopub_client.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ namespace xeus

private:
zmq::socket_t m_iopub;
std::string m_iopub_end_point;

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

0 comments on commit 2544d77

Please sign in to comment.