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());
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.
A stream abstraction for datagram communication.
void endPacket() override
Mark the end of a logical packet (see beginPacket).
virtual bool join(const Contact &group, bool sender, const Contact &ipLocal)
void beginPacket() override
Mark the beginning of a logical packet.
void flush() override
Make sure all pending write operations are finished.
bool isOk() const override
Check if the stream is ok or in an error state.
static Contact getAddress()
#define yCDebug(component,...)
#define YARP_OS_LOG_COMPONENT(name, name_string)
The components from which ports and connections are built.
An interface to the operating system, including Port based communication.