Free Electron
MessageReliableUDPI.h
1 /* Copyright (C) 2003-2021 Free Electron Organization
2  Any use of this software requires a license. If a valid license
3  was not distributed with this file, visit freeelectron.org. */
4 
5 #ifndef __MessageReliableUDPI_h__
6 #define __MessageReliableUDPI_h__
7 
8 namespace fe
9 {
10 namespace ext
11 {
12 
13 /**************************************************************************//**
14  @brief Message Sender/Receiver multi-packet reliable over UDP
15 
16  @ingroup message
17 *//***************************************************************************/
18 class FE_DL_EXPORT MessageReliableUDPI :
19  virtual public fe::Component,
20  public fe::CastableAs<MessageReliableUDPI>
21 {
22 public:
23  /// @brief Start receive and transmit thread and initialize the receive port (0 = open port)
24  virtual bool start(uint16_t receivePort) = 0;
25 
26  /// @brief Returns the selected receive port
27  virtual uint16_t getReceivePort() = 0;
28 
29  /// @brief Shutdown receive and transmit thread and the message systems
30  virtual void shutdown() = 0;
31 
32  /// @brief Check to see if a message has been received. The receiver is responsible for deleting the message
33  virtual bool recvReliableFrom(uint8_t **msg, uint32_t &msgSize, char *fromIPaddress) = 0;
34 
35  /// @brief Send a reliable message over UDP to the address and port given
36  virtual bool sendReliableTo(const uint8_t *msg, const uint32_t msgSize, const char *ipAddress, uint16_t port) = 0;
37 };
38 
39 } // namespace ext
40 } // namespace fe
41 
42 #endif // __MessageReliableUDPI_h__
kernel
Definition: namespace.dox:3
Message Sender/Receiver multi-packet reliable over UDP.
Definition: MessageReliableUDPI.h:18
Base for all interfacable components.
Definition: Component.h:20
Per-class participation non-RTTI fallback dynamic casting mechanism.
Definition: Castable.h:192