We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent ca291a7 commit f39ab3eCopy full SHA for f39ab3e
1 file changed
appsec/src/helper/network/broker.cpp
@@ -97,13 +97,19 @@ bool broker::send(
97
// TODO: Add check to ensure buffer.size() fits in uint32_t
98
header_t h = {"dds", (uint32_t)buffer.size()};
99
100
+ static constexpr auto timeout_header{std::chrono::milliseconds{100}};
101
+ socket_->set_send_timeout(timeout_header);
102
+
103
// NOLINTNEXTLINE
104
auto res = socket_->send(reinterpret_cast<char *>(&h), sizeof(header_t));
105
106
if (res != sizeof(header_t)) {
107
return false;
108
}
109
110
+ static constexpr auto timeout_msg_body{std::chrono::milliseconds{300}};
111
+ socket_->set_send_timeout(timeout_msg_body);
112
113
res = socket_->send(buffer.c_str(), buffer.size());
114
115
return res == buffer.size();
0 commit comments