OpenDaVINCI  4.15.3
WIN32TCPAcceptor.h
Go to the documentation of this file.
1 
20 #ifndef OPENDAVINCI_CORE_WRAPPER_WIN32IMPL_WIN32TCPACCEPTOR_H_
21 #define OPENDAVINCI_CORE_WRAPPER_WIN32IMPL_WIN32TCPACCEPTOR_H_
22 
23 #include <memory>
24 
26 
27 #include <memory>
34 
35 namespace odcore {
36  namespace wrapper {
37  namespace WIN32Impl {
38 
39  using namespace std;
40 
42  private:
43  static const int32_t BACKLOG = 100;
44 
45  private:
52 
58  WIN32TCPAcceptor& operator=(const WIN32TCPAcceptor &);
59 
60  public:
61  WIN32TCPAcceptor(const uint32_t& port);
62  virtual ~WIN32TCPAcceptor();
63 
64  virtual void setAcceptorListener(odcore::io::tcp::TCPAcceptorListener* listener);
65 
66  virtual void start();
67  virtual void stop();
68 
69  virtual bool isRunning();
70  virtual void run();
71 
72  protected:
73  void invokeAcceptorListener(std::shared_ptr<odcore::io::tcp::TCPConnection> connection);
74 
75  unique_ptr<Thread> m_thread;
76 
77  unique_ptr<Mutex> m_listenerMutex;
79 
81  int32_t m_port;
82  };
83  }
84  }
85 }
86 #endif /* OPENDAVINCI_CORE_WRAPPER_WIN32IMPL_WIN32TCPACCEPTOR_H_ */
Definition: TCPAcceptorListener.h:33
Definition: TCPAcceptor.h:31
Definition: WIN32TCPAcceptor.h:41
int32_t m_port
Definition: WIN32TCPAcceptor.h:81
int32_t m_fileDescriptor
Definition: WIN32TCPAcceptor.h:80
Definition: Runnable.h:35
unique_ptr< Mutex > m_listenerMutex
Definition: WIN32TCPAcceptor.h:77
unique_ptr< Thread > m_thread
Definition: WIN32TCPAcceptor.h:75
odcore::io::tcp::TCPAcceptorListener * m_listener
Definition: WIN32TCPAcceptor.h:78