Simplify the handling of send/receive timeouts

This commit is contained in:
Alexey Rybalchenko
2015-11-19 15:30:37 +01:00
committed by Florian Uhlig
parent 0894900f52
commit afda64a83d
3 changed files with 53 additions and 73 deletions

View File

@@ -37,47 +37,27 @@ class TransferTimeoutTester : public FairMQDevice
bool sendCanceling = false;
bool receiveCanceling = false;
if (fChannels.at("data-out").at(0).SetSendTimeout(1000))
fChannels.at("data-out").at(0).SetSendTimeout(1000);
fChannels.at("data-in").at(0).SetReceiveTimeout(1000);
if (fChannels.at("data-out").at(0).GetSendTimeout() == 1000)
{
setSndOK = true;
LOG(INFO) << "set send timeout OK";
getSndOK = true;
LOG(INFO) << "get send timeout OK: " << fChannels.at("data-out").at(0).GetSendTimeout();
}
else
{
LOG(ERROR) << "set send timeout failed";
LOG(ERROR) << "get send timeout failed";
}
if (fChannels.at("data-in").at(0).SetReceiveTimeout(1000))
if (fChannels.at("data-in").at(0).GetReceiveTimeout() == 1000)
{
setRcvOK = true;
LOG(INFO) << "set receive timeout OK";
getRcvOK = true;
LOG(INFO) << "get receive timeout OK: " << fChannels.at("data-in").at(0).GetReceiveTimeout();
}
else
{
LOG(ERROR) << "set receive timeout failed";
}
if (setSndOK && setRcvOK)
{
if (fChannels.at("data-out").at(0).GetSendTimeout() == 1000)
{
getSndOK = true;
LOG(INFO) << "get send timeout OK: " << fChannels.at("data-out").at(0).GetSendTimeout();
}
else
{
LOG(ERROR) << "get send timeout failed";
}
if (fChannels.at("data-in").at(0).GetReceiveTimeout() == 1000)
{
getRcvOK = true;
LOG(INFO) << "get receive timeout OK: " << fChannels.at("data-in").at(0).GetReceiveTimeout();
}
else
{
LOG(ERROR) << "get receive timeout failed";
}
LOG(ERROR) << "get receive timeout failed";
}
if (getSndOK && getRcvOK)