Skip to content

Commit

Permalink
Decrease cadence at which signon messages are sent while awaiting a r…
Browse files Browse the repository at this point in the history
…esponse
  • Loading branch information
langmm committed Aug 31, 2023
1 parent fa4e5a7 commit 5768e25
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions communication/communicators/ClientComm.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -64,14 +64,18 @@ bool ClientComm::signon(const Header& header, Comm_t* async_comm) {
Header tmp(true);
clock_t start = clock();
int tout = get_timeout_recv();
int nloop = 0;
while ((!requests.signon_complete) &&
(tout < 0 ||
(((double)(clock() - start))*1000000/CLOCKS_PER_SEC) < tout)) {
ygglog_debug << "ClientComm(" << name << ")::signon: Sending signon" << std::endl;
if (async_comm->send(YGG_CLIENT_SIGNON, YGG_CLIENT_SIGNON_LEN) < 0) {
ygglog_error << "ClientComm(" << name << ")::signon: Error in sending sign-on" << std::endl;
return false;
if ((nloop % 2) == 0) {
ygglog_debug << "ClientComm(" << name << ")::signon: Sending signon" << std::endl;
if (async_comm->send(YGG_CLIENT_SIGNON, YGG_CLIENT_SIGNON_LEN) < 0) {
ygglog_error << "ClientComm(" << name << ")::signon: Error in sending sign-on" << std::endl;
return false;
}
}
nloop++;
if ((flags & COMM_FLAG_ASYNC_WRAPPED) && (async_comm != this))
return true;
if (requests.activeComm()->comm_nmsg(RECV) > 0) {
Expand Down

0 comments on commit 5768e25

Please sign in to comment.