OpenDaVINCI  4.15.3
WIN32UDPReceiver.h
Go to the documentation of this file.
1 
20 #ifndef OPENDAVINCI_CORE_WRAPPER_WIN32IMPL_WIN32UDPRECEIVER_H_
21 #define OPENDAVINCI_CORE_WRAPPER_WIN32IMPL_WIN32UDPRECEIVER_H_
22 
23 #include <memory>
24 
26 
32 
33 namespace odcore {
34  namespace wrapper {
35  namespace WIN32Impl {
36 
37  using namespace std;
38 
45  private:
47 
55  WIN32UDPReceiver(const string &address, const uint32_t &port, const bool &isMulticast);
56 
57  private:
58  enum {
59  BUFFER_SIZE = 65535
60  };
61 
62  private:
69 
75  WIN32UDPReceiver& operator=(const WIN32UDPReceiver &);
76 
77  public:
78  virtual ~WIN32UDPReceiver();
79 
80  virtual void start();
81 
82  virtual void stop();
83 
84  virtual void setSenderPortToIgnore(const uint16_t &portToIgnore);
85 
86  private:
87  const char* inet_ntop(int af, const void* src, char* dst, int cnt);
88 
89  private:
90  bool m_isMulticast;
91  struct sockaddr_in m_address;
92  struct ip_mreq m_mreq;
93  int32_t m_fd;
94  char *m_buffer;
95  unique_ptr<Thread> m_thread;
96 
97  virtual void run();
98 
99  virtual bool isRunning();
100  };
101 
102  }
103  }
104 } // odcore::wrapper::WIN32Impl
105 
106 #endif /*OPENDAVINCI_CORE_WRAPPER_WIN32IMPL_WIN32UDPRECEIVER_H_*/
Definition: WIN32UDPReceiver.h:44
Definition: NetworkLibraryProducts.h:29
Definition: Runnable.h:35
Definition: UDPReceiver.h:82
Definition: POSIXUDPReceiver.h:36