FairMQ/fairmq/test/req-rep/runTestRep.cxx
2016-06-01 11:49:33 +02:00

64 lines
1.7 KiB
C++

/********************************************************************************
* Copyright (C) 2014 GSI Helmholtzzentrum fuer Schwerionenforschung GmbH *
* *
* This software is distributed under the terms of the *
* GNU Lesser General Public Licence version 3 (LGPL) version 3, *
* copied verbatim in the file "LICENSE" *
********************************************************************************/
/**
* runTestRep.cxx
*
* @since 2015-09-05
* @author A. Rybalchenko
*/
#include <iostream>
#include "FairMQLogger.h"
#include "FairMQTestRep.h"
int main(int argc, char** argv)
{
FairMQTestRep testRep;
testRep.CatchSignals();
if (argc == 2)
{
testRep.SetTransport(argv[1]);
}
else
{
testRep.SetTransport("zeromq");
}
reinit_logger(false);
testRep.SetProperty(FairMQTestRep::Id, "testRep");
FairMQChannel repChannel("rep", "bind", "tcp://127.0.0.1:5558");
if (argc == 2)
{
repChannel.UpdateAddress("tcp://127.0.0.1:5758");
}
repChannel.UpdateRateLogging(0);
testRep.fChannels["data"].push_back(repChannel);
testRep.ChangeState("INIT_DEVICE");
testRep.WaitForEndOfState("INIT_DEVICE");
testRep.ChangeState("INIT_TASK");
testRep.WaitForEndOfState("INIT_TASK");
testRep.ChangeState("RUN");
testRep.WaitForEndOfState("RUN");
testRep.ChangeState("RESET_TASK");
testRep.WaitForEndOfState("RESET_TASK");
testRep.ChangeState("RESET_DEVICE");
testRep.WaitForEndOfState("RESET_DEVICE");
testRep.ChangeState("END");
return 0;
}