iCub-main
Loading...
Searching...
No Matches
relay.cpp
Go to the documentation of this file.
1// -*- mode:C++; tab-width:4; c-basic-offset:4; indent-tabs-mode:nil -*-
2
16#include <yarp/os/all.h>
17#include <iostream>
18
19using namespace std;
20using namespace yarp::os;
21
22int main(int argc, char **argv) {
23 Network yarp;
24 BufferedPort<Bottle> inPort;
25 inPort.open("/relay/in");
26
27 BufferedPort<Bottle> outPort;
28 outPort.open("/relay/out");
29
30 while (true) {
31 cout << "waiting for input" << endl;
32 Bottle *input = inPort.read();
33 if (input!=NULL)
34 {
35 Bottle& output = outPort.prepare();
36 output=*input;
37
38 cout << "writing " << output.toString() << endl;
39 outPort.write();
40 }
41 }
42 return 0;
43}
int main()
Definition main.cpp:67
Copyright (C) 2008 RobotCub Consortium.