21 #ifndef XAPIAN_INCLUDED_TCPSERVER_H
22 #define XAPIAN_INCLUDED_TCPSERVER_H
26 # define SOCKET_INITIALIZER_MIXIN : private WinsockInitializer
28 # define SOCKET_INITIALIZER_MIXIN
64 TcpServer(
const std::string& host,
int port,
bool tcp_nodelay,
TCP/IP replication client class.
TcpServer(const std::string &host, int port, bool tcp_nodelay, bool verbose_)
Construct a TcpServer and start listening for connections.
int accept_connection()
Accept a connection and return the file descriptor for it.
TcpServer & operator=(const TcpServer &)=delete
Don't allow assignment.
bool verbose
Should we produce output when connections are made or lost?
virtual void handle_one_connection(int socket)=0
Handle a single connection on an already connected socket.
void run_once()
Accept a single connection, service requests on it, then stop.
void run()
Accept connections and service requests indefinitely.
bool get_verbose() const
Should we produce output when connections are made or lost?
TcpServer(const TcpServer &)=delete
Don't allow copying.
int listener
The socket we're listening on.
Socket handling utilities.
Define XAPIAN_VISIBILITY_* macros.
#define XAPIAN_VISIBILITY_DEFAULT
#define XAPIAN_VISIBILITY_INTERNAL