YARP
Yet Another Robot Platform
TcpFace.h
Go to the documentation of this file.
1 /*
2  * SPDX-FileCopyrightText: 2006-2021 Istituto Italiano di Tecnologia (IIT)
3  * SPDX-FileCopyrightText: 2006-2010 RobotCub Consortium
4  * SPDX-License-Identifier: BSD-3-Clause
5  */
6 
7 #ifndef YARP_OS_IMPL_TCPFACE_H
8 #define YARP_OS_IMPL_TCPFACE_H
9 
10 #include <yarp/conf/system.h>
11 
12 #include <yarp/os/Face.h>
13 #include <yarp/os/impl/AuthHMAC.h>
15 
16 namespace yarp {
17 namespace os {
18 namespace impl {
19 
24 {
25 public:
27 
28  ~TcpFace() override;
29 
30  bool open(const Contact& address) override;
31  void close() override;
32  InputProtocol* read() override;
33  OutputProtocol* write(const Contact& address) override;
34 
35  Contact getLocalAddress() const override;
36 
37  /*
38  * This class like all classes except the port objects does
39  * not have any notion of running in a multi-threaded environment.
40  */
41 
42 protected:
44 
45 private:
46  void closeFace();
47  Contact address;
48  yarp::os::impl::TcpAcceptor peerAcceptor;
49 };
50 
51 
52 } // namespace impl
53 } // namespace os
54 } // namespace yarp
55 
56 #endif // YARP_OS_IMPL_TCPFACE_H
Represents how to reach a part of a YARP network.
Definition: Contact.h:36
The initial point-of-contact with a port.
Definition: Face.h:21
The input side of an active connection between two ports.
Definition: InputProtocol.h:35
The output side of an active connection between two ports.
3-way authentication via HMAC
Definition: AuthHMAC.h:31
Communicating with a port via TCP.
Definition: TcpFace.h:24
yarp::os::impl::AuthHMAC auth
Definition: TcpFace.h:43
bool read(ImageOf< PixelRgb > &dest, const std::string &src, image_fileformat format=FORMAT_ANY)
Definition: ImageFile.cpp:922
bool write(const ImageOf< PixelRgb > &src, const std::string &dest, image_fileformat format=FORMAT_PPM)
Definition: ImageFile.cpp:1098
The main, catch-all namespace for YARP.
Definition: dirs.h:16
#define YARP_os_impl_API
Definition: api.h:46