Belle II Software  release-05-02-19
TCPServerSocket.h
1 #ifndef _B2ARICH_TCPServerSocket_hh_
2 #define _B2ARICH_TCPServerSocket_hh_
3 
4 #include "daq/slc/system/TCPSocket.h"
5 #include "daq/slc/system/FileDescriptor.h"
6 
7 namespace Belle2 {
14 
15  public:
17  : m_ip(""), m_port(0) {}
18  TCPServerSocket(const std::string& ip, unsigned short port)
19  : m_ip(ip), m_port(port) {}
20  virtual ~TCPServerSocket() {}
21 
22  public:
23  void setIP(const std::string& ip) { m_ip = ip; }
24  void setPort(unsigned short port) { m_port = port; }
25  const std::string& getIP() const { return m_ip; }
26  unsigned short getPort() const { return m_port; }
27  int open(int nqueue = 5);
28  int open(const std::string& ip, unsigned short port, int nqueue = 5);
29  TCPSocket accept();
30 
31  private:
32  std::string m_ip;
33  unsigned short m_port;
34 
35  };
36 
38 }
39 
40 #endif
41 
Belle2
Abstract base class for different kinds of events.
Definition: MillepedeAlgorithm.h:19
Belle2::TCPServerSocket
Definition: TCPServerSocket.h:13
Belle2::TCPSocket
Definition: TCPSocket.h:14
Belle2::FileDescriptor
Definition: FileDescriptor.h:10