35 if (fallback==
nullptr) {
42 if (fallback !=
nullptr) {
48 std::string
apply(
const std::string& txt,
const Contact& remote)
override {
56 result =
con2.getReader().expectText();
58 printf(
"ASKED %s, GAVE %s\n", txt.c_str(), result.c_str());
63 return fallback->
start();
75 if (implementation==
nullptr) {
82 if (implementation!=
nullptr) {
84 implementation =
nullptr;
90 if (implementation!=
nullptr) {
97 if (implementation!=
nullptr) {
122 if (
suggest.getHost() ==
"...") {
125 if (
suggest.getCarrier() ==
"...") {
133 if (
suggest.getRegName() ==
"...") {
141 if (
suggest.getHost() ==
"...") {
149 fprintf(
stderr,
"Overriding non-local address for name server\n");
155 fprintf(
stderr,
"Overriding loopback address for name server\n");
170 fprintf(
stderr,
" Current settings: host %s port %d family %s\n",
173 fprintf(
stderr,
" Desired settings: host %s port %d family %s\n",
175 fprintf(
stderr,
"Please specify '--write' if it is ok to overwrite current settings, or\n");
176 fprintf(
stderr,
"Please specify '--read' to use the current settings, or\n");
198 addr.setName(
"fallback");
Adapt YARP multicast server to use a different NameService.
BootstrapServerAdapter(NameService &owner)
virtual ~BootstrapServerAdapter()
std::string apply(const std::string &txt, const Contact &remote) override
static bool configFileBootstrap(yarp::os::Contact &contact, bool configFileRequired, bool mayEditConfigFile)
BootstrapServer(NameService &owner)
yarp::os::Contact where()
virtual ~BootstrapServer()
Manage a single connection to the name server.
virtual bool apply(yarp::os::ConnectionReader &reader, yarp::os::ConnectionWriter *writer, bool lock=true)
Abstract interface for a name server operator.
A mini-server for performing network communication in the background.
An interface for writing to a network connection.
virtual void appendText(const std::string &str, const char terminate='\n')=0
Send a terminated string to the network connection.
A dummy connection to test yarp::os::Portable implementations.
ConnectionWriter & getWriter()
Get the dummy ConnectionWriter loaded with whatever was written the ConnectionWriter since it was las...
void setTextMode(bool textmode)
Set the textMode of the dummy connection.
ConnectionReader & getReader(ConnectionWriter *replyWriter=nullptr)
Get the dummy ConnectionReader loaded with whatever was written the ConnectionWriter since it was las...
Multi-cast server, for last resort information sharing about name information – when config files are...
static Contact getAddress()
Small helper class to help deal with legacy YARP configuration files.
std::string getNamespace(bool refresh=false)
static std::string getHostName(bool prefer_loopback=false, const std::string &seed="")
static bool isLocalName(const std::string &name)
bool fromFile(const char *ns=nullptr)
std::string getConfigFileName(const char *stem=nullptr, const char *ns=nullptr)
void setAddress(const Contact &address)
bool toFile(bool clean=false)
Stub for a YARP2-conforming name server.
The components from which ports and connections are built.
An interface to the operating system, including Port based communication.