Belle II Software development
TCPServerSocket.h
1/**************************************************************************
2 * basf2 (Belle II Analysis Software Framework) *
3 * Author: The Belle II Collaboration *
4 * *
5 * See git log for contributors and copyright holders. *
6 * This file is licensed under LGPL-3.0, see LICENSE.md. *
7 **************************************************************************/
8#ifndef _B2ARICH_TCPServerSocket_hh_
9#define _B2ARICH_TCPServerSocket_hh_
10
11#include "daq/slc/system/TCPSocket.h"
12#include "daq/slc/system/FileDescriptor.h"
13
14namespace Belle2 {
21
22 public:
24 : m_ip(""), m_port(0) {}
25 TCPServerSocket(const std::string& ip, unsigned short port)
26 : m_ip(ip), m_port(port) {}
27 virtual ~TCPServerSocket() {}
28
29 public:
30 void setIP(const std::string& ip) { m_ip = ip; }
31 void setPort(unsigned short port) { m_port = port; }
32 const std::string& getIP() const { return m_ip; }
33 unsigned short getPort() const { return m_port; }
34 int open(int nqueue = 5);
35 int open(const std::string& ip, unsigned short port, int nqueue = 5);
36 TCPSocket accept();
37
38 private:
39 std::string m_ip;
40 unsigned short m_port;
41
42 };
43
45}
46
47#endif
48
Abstract base class for different kinds of events.