Browse Source

Tests: PityTest - transport var rename

master
heck 4 years ago
parent
commit
6862aebb7e
  1. 8
      src/PityTransport.cc
  2. 2
      src/PityTransport.hh

8
src/PityTransport.cc

@ -74,7 +74,9 @@ namespace pEp {
return ret; return ret;
} }
std::string PityTransport::receiveMsg(int timeout_msec) const // Blocking
// Returns when a msg has been received
std::string PityTransport::receiveMsg(int poll_interval) const
{ {
pEpLogClass("called"); pEpLogClass("called");
std::string ret; std::string ret;
@ -84,8 +86,8 @@ namespace pEp {
ret = pollMsg(); ret = pollMsg();
retry = false; retry = false;
} catch (const std::underflow_error&) { } catch (const std::underflow_error&) {
pEpLogClass("polling again in [ms]: " + std::to_string(timeout_msec) + "..."); pEpLogClass("polling again in [ms]: " + std::to_string(poll_interval) + "...");
Utils::sleep_millis(timeout_msec); Utils::sleep_millis(poll_interval);
retry = true; retry = true;
} }
} while (retry); } while (retry);

2
src/PityTransport.hh

@ -25,7 +25,7 @@ namespace pEp {
bool hasMsg() const; bool hasMsg() const;
void sendMsg(const std::string nodename, const std::string& msg) const; void sendMsg(const std::string nodename, const std::string& msg) const;
std::string pollMsg() const; std::string pollMsg() const;
std::string receiveMsg(int timeout_msec = 100) const; std::string receiveMsg(int poll_interval = 100) const;
//internal logging //internal logging
static bool debug_log_enabled; static bool debug_log_enabled;

Loading…
Cancel
Save