OpenDaVINCI  4.16.0
WIN32TCPConnection.h
Go to the documentation of this file.
1 
20 #ifndef OPENDAVINCI_CORE_WRAPPER_WIN32IMPL_WIN32TCPCONNECTION_H_
21 #define OPENDAVINCI_CORE_WRAPPER_WIN32IMPL_WIN32TCPCONNECTION_H_
22 
23 #include <memory>
24 #include <string>
25 
27 
32 
33 namespace odcore {
34  namespace wrapper {
35  namespace WIN32Impl {
36 
37  using namespace std;
38 
40  private:
47 
53  WIN32TCPConnection& operator=(const WIN32TCPConnection &);
54 
55  public:
56  WIN32TCPConnection(const int32_t &fileDescriptor);
57 
58  WIN32TCPConnection(const std::string &ip, const uint32_t &port);
59 
60  virtual ~WIN32TCPConnection();
61 
62  virtual void sendImplementation(const std::string& data);
63 
64  virtual void start();
65  virtual void stop();
66 
67  virtual bool isRunning();
68  virtual void run();
69 
70  protected:
71  void initialize();
72 
73  unique_ptr<Thread> m_thread;
74 
75  unique_ptr<Mutex> m_socketMutex;
77 
78  enum {BUFFER_SIZE = 65535};
79  char m_buffer[BUFFER_SIZE];
80  std::string m_ip;
81  uint32_t m_port;
82  };
83  }
84  }
85 }
86 #endif /* OPENDAVINCI_CORE_WRAPPER_WIN32IMPL_WIN32TCPCONNECTION_H_ */
std::string m_ip
Definition: WIN32TCPConnection.h:80
Definition: WIN32TCPConnection.h:39
int32_t m_fileDescriptor
Definition: WIN32TCPConnection.h:76
Definition: Runnable.h:35
unique_ptr< Thread > m_thread
Definition: WIN32TCPConnection.h:73
uint32_t m_port
Definition: WIN32TCPConnection.h:81
Definition: TCPConnection.h:40
unique_ptr< Mutex > m_socketMutex
Definition: WIN32TCPConnection.h:75