37 this->address = address;
44 this->address = address;
50 int result = peerAcceptor.open(address);
52 this->address = address;
55 peerAcceptor.get_port_number());
68void TcpFace::closeFace()
80 yCError(
TCPFACE,
"Authentication was enabled in the auth.conf file.");
81 yCError(
TCPFACE,
"If you do not want to use authentication, please");
83 yCError(
TCPFACE,
"If you do want to set up authentication, check:");
95 int result = stream->open(peerAcceptor);
103 if (stream !=
nullptr) {
104 stream->setReadTimeout(2.0);
105 stream->setWriteTimeout(2.0);
107 bool success =
auth.
authSource(&(stream->getInputStream()), &(stream->getOutputStream()));
112 stream->setReadTimeout(0.);
113 stream->setWriteTimeout(0.);
123 int result = stream->open(address);
130 if (stream !=
nullptr) {
131 stream->setReadTimeout(2.0);
132 stream->setWriteTimeout(2.0);
134 bool success =
auth.
authDest(&(stream->getInputStream()), &(stream->getOutputStream()));
139 stream->setReadTimeout(0.);
140 stream->setWriteTimeout(0.);
A mini-server for performing network communication in the background.
The output side of an active connection between two ports.
bool authDest(yarp::os::InputStream *streamIn, yarp::os::OutputStream *streamOut)
bool authSource(yarp::os::InputStream *streamIn, yarp::os::OutputStream *streamOut)
static std::string getHostName(bool prefer_loopback=false, const std::string &seed="")
Connection choreographer.
A stream abstraction for socket communication.
InputProtocol * read() override
return nullptr on failure.
Contact getLocalAddress() const override
Get address after open(), if more specific that the address provided to open() - otherwise an invalid...
bool open(const Contact &address) override
Start listening to the given address.
void close() override
Stop listening.
yarp::os::impl::AuthHMAC auth
OutputProtocol * write(const Contact &address) override
Try to reach out and talk to someone.
#define yCError(component,...)
#define yCAssert(component, x)
#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.