|
YARP
Yet Another Robot Platform
|
|
Go to the documentation of this file.
38 yCDebug(TCPFACE,
"opening for address %s", address.
toURI().c_str());
40 this->address = address;
42 ACE_INET_Addr serverAddr((address.
getPort() > 0) ? address.
getPort() : 0);
43 int result = peerAcceptor.open(serverAddr, 1);
45 ACE_INET_Addr localAddr;
46 peerAcceptor.get_local_addr(localAddr);
47 this->address = address;
50 localAddr.get_port_number());
53 int result = peerAcceptor.open(address);
55 this->address = address;
58 peerAcceptor.get_port_number());
61 yCDebug(TCPFACE,
"Opened at address %s", this->address.
toURI().c_str());
71 void TcpFace::closeFace()
73 if (address.isValid()) {
82 yCError(TCPFACE,
"Authentication failed.");
83 yCError(TCPFACE,
"Authentication was enabled in the auth.conf file.");
84 yCError(TCPFACE,
"If you do not want to use authentication, please");
85 yCError(TCPFACE,
"remove this file.");
86 yCError(TCPFACE,
"If you do want to set up authentication, check:");
87 yCError(TCPFACE,
" http://www.yarp.it/yarp_port_auth.html");
96 yCAssert(TCPFACE, stream !=
nullptr);
98 int result = stream->open(peerAcceptor);
106 if (stream !=
nullptr) {
107 stream->setReadTimeout(2.0);
108 stream->setWriteTimeout(2.0);
110 bool success = auth.authSource(&(stream->getInputStream()), &(stream->getOutputStream()));
115 stream->setReadTimeout(0.);
116 stream->setWriteTimeout(0.);
126 int result = stream->open(address);
133 if (stream !=
nullptr) {
134 stream->setReadTimeout(2.0);
135 stream->setWriteTimeout(2.0);
137 bool success = auth.authDest(&(stream->getInputStream()), &(stream->getOutputStream()));
142 stream->setReadTimeout(0.);
143 stream->setWriteTimeout(0.);
void close() override
Stop listening.
Contact getLocalAddress() const override
Get address after open(), if more specific that the address provided to open() - otherwise an invalid...
The output side of an active connection between two ports.
static std::string getHostName(bool prefer_loopback=false, const std::string &seed="")
OutputProtocol * write(const Contact &address) override
Try to reach out and talk to someone.
A stream abstraction for socket communication.
Connection choreographer.
bool open(const Contact &address) override
Start listening to the given address.
#define yCAssert(component, x)
#define yCError(component,...)
An interface to the operating system, including Port based communication.
#define yCDebug(component,...)
#define YARP_OS_LOG_COMPONENT(name, name_string)
The components from which ports and connections are built.
InputProtocol * read() override
return nullptr on failure.