Skip to content

Commit

Permalink
more of the same
Browse files Browse the repository at this point in the history
  • Loading branch information
pnorbert committed Jul 11, 2024
1 parent 10d791e commit 52f9734
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions source/adios2/helper/adiosNetwork.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -413,18 +413,20 @@ void NetworkSocket::RequestResponse(const std::string &request, char *response,
#ifdef _WIN32
int result;
int len = static_cast<int>(request.length());
int maxlen = static_cast<int>(maxResponseSize) - 1;
#else
ssize_t result;
size_t len = request.length();
size_t maxlen = maxResponseSize - 1;
#endif
write(m_Data->m_Socket, request.c_str(), len);
result = write(m_Data->m_Socket, request.c_str(), len);
if (result == -1)
{
helper::Throw<std::ios_base::failure>("Helper", "helper:adiosNetwork", "RequestResponse",
"error: Cannot send request");
}

result = read(m_Data->m_Socket, response, maxResponseSize - 1);
result = read(m_Data->m_Socket, response, maxlen);
if (result == -1)
{
helper::Throw<std::ios_base::failure>("Helper", "helper:adiosNetwork", "RequestResponse",
Expand Down

0 comments on commit 52f9734

Please sign in to comment.