mirror of
https://github.com/FairRootGroup/FairMQ.git
synced 2026-11-25 13:11:36 +00:00
- Channel.GetNumberOfConnectedPeers slept 100 ms and then expected the peer count; on a slow runner the count can change later - poll the count with a deadline instead - remove the 500 ms sleep in Init() of the MultipleDevices sender and receiver: the transfer does not depend on the order of bind and connect Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
44 lines
1.2 KiB
C++
44 lines
1.2 KiB
C++
/********************************************************************************
|
|
* Copyright (C) 2015-2022 GSI Helmholtzzentrum fuer Schwerionenforschung GmbH *
|
|
* *
|
|
* This software is distributed under the terms of the *
|
|
* GNU Lesser General Public Licence (LGPL) version 3, *
|
|
* copied verbatim in the file "LICENSE" *
|
|
********************************************************************************/
|
|
|
|
#ifndef FAIR_MQ_TEST_TESTSENDER_H
|
|
#define FAIR_MQ_TEST_TESTSENDER_H
|
|
|
|
#include <fairmq/Device.h>
|
|
#include <fairlogger/Logger.h>
|
|
|
|
#include <string>
|
|
|
|
namespace fair::mq::test
|
|
{
|
|
|
|
class Sender : public Device
|
|
{
|
|
public:
|
|
Sender(const std::string& channelName)
|
|
: fChannelName(channelName)
|
|
{}
|
|
|
|
protected:
|
|
auto Run() -> void override
|
|
{
|
|
auto msg = NewMessage();
|
|
if (Send(msg, fChannelName) >= 0) {
|
|
LOG(info) << "sent empty message";
|
|
} else {
|
|
LOG(error) << "fair::mq::test::Sender::Run(): Send(msg, fChannelName) < 0";
|
|
}
|
|
};
|
|
|
|
std::string fChannelName;
|
|
};
|
|
|
|
} // namespace fair::mq::test
|
|
|
|
#endif // FAIR_MQ_TEST_TESTSENDER_H
|