#include <string>
#include <boost/test/minimal.hpp>
#include <RCF/RcfServer.hpp>
#include <RCF/TcpEndpoint.hpp>
#include <RCF/UdpEndpoint.hpp>
#include <RCF/util/CommandLine.hpp>
#include <RCF/util/PortNumbers.hpp>
#include "Test_Performance.hpp"
// uncomment to see if dynamic memory allocation is making a difference
//void operator delete(void *pv) {}
int test_main(int argc, char **argv)
{
util::CommandLineOption<int> transport("transport", 0, "transport protocol (tcp=0, udp=1)");
util::CommandLineOption<int> port( "port", util::Ports::getNext(), "port number" );
util::CommandLine::getSingleton().parse(argc, argv);
if (transport.get() == 0)
{
std::cout << "Using tcp\n";
X x;
RCF::RcfServer server(( RCF::TcpEndpoint(port) ));
server.bind<I_X>(x);
server.startInThisThread();
}
else
{
std::cout << "Using udp\n";
X x;
RCF::RcfServer server(( RCF::UdpEndpoint(port) ));
server.bind<I_X>(x);
server.startInThisThread();
}
return boost::exit_success;
}