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