12 #include <sys/socket.h>
28 TcpStream::TcpStream() =
default;
30 TcpStream::~TcpStream() =
default;
34 set_handle(socket(AF_INET, SOCK_STREAM, 0));
35 if (get_handle() == -1) {
36 yCError(TCPSTREAM_POSIX,
"At TcpStream::open there was an error: %d, %s", errno, strerror(errno));
42 int TcpStream::get_local_addr(sockaddr & sa)
45 if (::getsockname(get_handle(), &sa,
reinterpret_cast<socklen_t*
>(&len)) == -1) {
51 int TcpStream::get_remote_addr (sockaddr & sa)
54 if (::getpeername(get_handle(), &sa,
reinterpret_cast<socklen_t*
>(&len)) == -1) {
#define yCError(component,...)
#define YARP_OS_LOG_COMPONENT(name, name_string)
The components from which ports and connections are built.