|
YARP
Yet Another Robot Platform
|
|
Go to the documentation of this file.
40 send.
join(getAddress(),
true);
41 listen.join(getAddress(),
false);
43 yCDebug(FALLBACKNAMESERVER,
"Fallback server running");
44 while (listen.isOk() && send.
isOk() && !closed) {
45 yCDebug(FALLBACKNAMESERVER,
"Fallback server waiting");
48 msg = listen.readLine();
50 yCDebug(FALLBACKNAMESERVER,
"Fallback server got something");
51 if (listen.isOk() && !closed) {
52 yCDebug(FALLBACKNAMESERVER,
"Fallback server got %s", msg.c_str());
53 if (msg.find(
"NAME_SERVER ") == 0) {
55 std::string result = owner.apply(msg, addr);
57 send.
writeLine(result.c_str(), (
int)result.length());
void endPacket() override
Mark the end of a logical packet (see beginPacket).
static Contact getAddress()
virtual bool join(const Contact &group, bool sender, const Contact &ipLocal)
static int getDefaultPortRange()
Under normal operation, YARP has a name server that manages a pool of (socket) ports starting at a po...
virtual void writeLine(const char *data, int len)
Write some text followed by a line feed.
void beginPacket() override
Mark the beginning of a logical packet.
A stream abstraction for datagram communication.
An interface to the operating system, including Port based communication.
#define yCDebug(component,...)
bool isOk() const override
Check if the stream is ok or in an error state.
#define YARP_OS_LOG_COMPONENT(name, name_string)
The components from which ports and connections are built.
void flush() override
Make sure all pending write operations are finished.