Skip to content

Commit

Permalink
feat: adds shutdown before closing sockets
Browse files Browse the repository at this point in the history
  • Loading branch information
aritosteles committed Dec 26, 2024
1 parent 60cd77e commit 240667e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/agent/communicator/src/http_socket.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,7 @@ namespace http_client
{
try
{
m_socket.shutdown(boost::asio::ip::tcp::socket::shutdown_both);
m_socket.close();
}
catch (const std::exception& e)
Expand Down
3 changes: 2 additions & 1 deletion src/agent/communicator/src/https_socket.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,8 @@ namespace http_client
{
try
{
m_ssl_socket.shutdown();
m_ssl_socket.lowest_layer().shutdown(boost::asio::ip::tcp::socket::shutdown_both);
m_ssl_socket.lowest_layer().close();
}
catch (const std::exception& e)
{
Expand Down

0 comments on commit 240667e

Please sign in to comment.