Skip to content

Commit

Permalink
Fix receive_message function from xdealer class
Browse files Browse the repository at this point in the history
  • Loading branch information
anutosh491 committed Jun 27, 2024
1 parent b2a991c commit d1fe04d
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/client/xclient_zmq.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,12 @@ namespace xeus

std::optional<xmessage> xclient_zmq::check_shell_answer()
{
return p_client_impl->receive_on_shell(-1);
return p_client_impl->receive_on_shell(0);
}

std::optional<xmessage> xclient_zmq::check_control_answer()
{
return p_client_impl->receive_on_control(-1);
return p_client_impl->receive_on_control(0);
}

void xclient_zmq::register_shell_listener(const listener& l)
Expand Down
10 changes: 8 additions & 2 deletions src/client/xdealer_channel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,14 @@ namespace xeus
std::optional<zmq::multipart_t> xdealer_channel::receive_message(long timeout)
{
zmq::multipart_t wire_msg;
m_socket.set(zmq::sockopt::linger, static_cast<int>(timeout));
if (wire_msg.recv(m_socket))
zmq::recv_flags flags = zmq::recv_flags::none;

if (timeout == 0)
{
flags = zmq::recv_flags::dontwait;
}

if (wire_msg.recv(m_socket, static_cast<int>(flags)))
{
return wire_msg;
} else {
Expand Down

0 comments on commit d1fe04d

Please sign in to comment.