41 while (listen.
isOk() && send.
isOk() && !closed) {
48 if (listen.
isOk() && !closed) {
50 if (msg.find(
"NAME_SERVER ") == 0) {
52 std::string result = owner.
apply(msg,
addr);
54 send.
writeLine(result.c_str(), (
int)result.length());
A mini-server for performing network communication in the background.
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 interrupt() override
Interrupt the stream.
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()
virtual std::string apply(const std::string &txt, const Contact &remote)=0
#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.