Skip to content

Commit de7947b

Browse files
committedJan 23, 2025
1 parent ba4230d commit de7947b

File tree

1 file changed

+11
-3
lines changed

1 file changed

+11
-3
lines changed
 

‎src/zmqpp/socket.cpp

+11-3
Original file line numberDiff line numberDiff line change
@@ -118,13 +118,21 @@ void socket::close()
118118

119119
bool socket::send(std::string const& str, bool dont_block/* = false */)
120120
{
121-
return send(str, (dont_block) ? socket::dont_wait : socket::normal);
121+
message_t msg(str);
122+
return send(msg, (dont_block) ? socket::dont_wait : socket::normal);
122123
}
123124

124125
bool socket::receive(std::string &str, bool dont_block /* = false */)
125126
{
126-
// Unable to use message wrapper as this could be multipart legacy fallback
127-
return receive(str, (dont_block) ? socket::dont_wait : socket::normal);
127+
message msg;
128+
129+
bool ret = receive(msg, (dont_block) ? socket::dont_wait : socket::normal);
130+
if (ret)
131+
{
132+
msg.get(str, 0);
133+
}
134+
135+
return ret;
128136
}
129137

130138
bool socket::send(zmqpp::signal sig, bool dont_block/* = false */)

0 commit comments

Comments
 (0)
Please sign in to comment.