TraveSim Adapters  0.1
Protobuf adapters for TraveSim project
unicast_receiver.hpp
Go to the documentation of this file.
1 /**
2  * @file unicast_receiver.hpp
3  *
4  * @author Lucas Haug <lucas.haug@thuneratz.org>
5  * @author Lucas Schneider <lucas.schneider@thuneratz.org>
6  *
7  * @brief Receiver data using UDP in unicast mode
8  *
9  * @date 04/2021
10  *
11  * @copyright MIT License - Copyright (c) 2021 ThundeRatz
12  */
13 
15 
16 #ifndef __UNICAST_RECEIVER_H__
17 #define __UNICAST_RECEIVER_H__
18 
19 namespace travesim {
20 namespace udp {
21 /**
22  * @brief Receiver class using UDP in unicast mode
23  */
25  public Receiver {
26  public:
27  /**
28  * @brief Construct a new Unicast Receiver object
29  *
30  * @param receiver_address Address where to send data
31  * @param receiver_port Port where to send data
32  *
33  * @note The unicast addresses must be in the block 127.0.0.0/8, see
34  * [IANA IPv4 Address Space Registry]
35  * (https://www.iana.org/assignments/iana-ipv4-special-registry/iana-ipv4-special-registry.xhtml)
36  * or the [RFC6890](https://tools.ietf.org/html/rfc6890) for more informations.
37  */
38  UnicastReceiver(const std::string receiver_address, const short receiver_port);
39 
40  /**
41  * @brief Destroy the Unicast Receiver object
42  */
44 
45  private:
46  /**
47  * @brief Open the socket with the desired options
48  */
49  void open_socket();
50 };
51 } // namespace udp
52 } // namespace travesim
53 
54 #endif // __UNICAST_RECEIVER_H__
void open_socket()
Open the socket with the desired options.
UnicastReceiver(const std::string receiver_address, const short receiver_port)
Construct a new Unicast Receiver object.
Receiver class using UDP in unicast mode.
Receiver data using UDP.
~UnicastReceiver()
Destroy the Unicast Receiver object.
Receiver class using UDP.
Definition: receiver.hpp:25