|
YARP
Yet Another Robot Platform
|
|
Go to the documentation of this file.
32 send.
join(call,
true);
33 listen.join(call,
false);
35 yCError(FALLBACKNAMECLIENT,
"Multicast not available");
38 std::string msg = std::string(
"NAME_SERVER query ") + nc.
getNamespace();
40 send.
writeLine(msg.c_str(), (
int)msg.length());
43 for (
int i = 0; i < 5; i++) {
45 std::string txt = listen.readLine();
50 yCDebug(FALLBACKNAMECLIENT,
"Fallback name client got %s", txt.c_str());
51 if (txt.find(
"registration ") == 0) {
53 yCInfo(FALLBACKNAMECLIENT,
"Received address %s", address.toURI().c_str());
80 for (
int k = 0; k < tries; k++) {
84 yCInfo(FALLBACKNAMECLIENT,
"Polling for name server (using multicast), try %d of max %d", k + 1, tries);
92 for (
int i0 = 0; i0 < len; i0++) {
93 fprintf(stderr,
"++");
95 fprintf(stderr,
"\n");
97 for (
int i = 0; i < len; i++) {
99 fprintf(stderr,
"++");
101 fprintf(stderr,
"\n");
105 fprintf(stderr,
"\n");
106 yCInfo(FALLBACKNAMECLIENT,
"No response to search for server");
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)
std::string getNamespace(bool refresh=false)
A client for the FallbackNameServer class.
virtual void writeLine(const char *data, int len)
Write some text followed by a line feed.
static void delaySystem(double seconds)
int join(double seconds=-1)
void beginPacket() override
Mark the beginning of a logical packet.
A stream abstraction for datagram communication.
#define yCError(component,...)
#define yCInfo(component,...)
An interface to the operating system, including Port based communication.
#define yCDebug(component,...)
static Contact extractAddress(const std::string &txt)
Extract an address from its text representation.
Small helper class to help deal with legacy YARP configuration files.
#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.