otsdaq  v2_05_02_indev
TCPClientBase.h
1 #ifndef _ots_TCPClientBase_h_
2 #define _ots_TCPClientBase_h_
3 
4 #include <string>
5 #include "otsdaq/NetworkUtilities/TCPTransceiverSocket.h"
6 
7 namespace ots
8 {
9 class TCPClientBase : public virtual TCPSocket
10 {
11  public:
12  // TCPClientBase();
13  TCPClientBase(const std::string& serverIP, int serverPort);
14  virtual ~TCPClientBase(void);
15 
16  bool connect(int retry = -1, unsigned int sleepMilliSeconds = 1000);
17  bool disconnect(void);
18 
19  private:
20  std::string fServerIP;
21  int fServerPort;
22  bool fConnected;
23 
24  void resolveServer(std::string& serverIP);
25 };
26 }
27 #endif