21 #ifndef XAPIAN_INCLUDED_TCPSERVER_H
22 #define XAPIAN_INCLUDED_TCPSERVER_H
26 # define SOCKET_INITIALIZER_MIXIN : private WinsockInitializer
28 # define SOCKET_INITIALIZER_MIXIN
31 #if defined __CYGWIN__ || defined __WIN32__
50 #if defined __CYGWIN__ || defined __WIN32__
67 #
if defined __CYGWIN__ || defined __WIN32__
89 TcpServer(
const std::string &host,
int port,
bool tcp_nodelay,
TCP/IP replication client class.
int accept_connection()
Accept a connection and return the file descriptor for it.
static int get_listening_socket(const std::string &host, int port, bool tcp_nodelay)
Create a listening socket ready to accept connections.
TcpServer(const TcpServer &)
Don't allow copying.
virtual ~TcpServer()
Destructor.
bool verbose
Should we produce output when connections are made or lost?
void operator=(const TcpServer &)
Don't allow assignment.
virtual void handle_one_connection(int socket)=0
Handle a single connection on an already connected socket.
int listen_socket
The socket we're listening on.
void run_once()
Accept a single connection, service requests on it, then stop.
void run()
Accept connections and service requests indefinitely.
TcpServer(const std::string &host, int port, bool tcp_nodelay, bool verbose)
Construct a TcpServer and start listening for connections.
RemoteConnection class used by the remote backend.
include <windows.h> without all the bloat and damage.
Define XAPIAN_VISIBILITY_* macros.
#define XAPIAN_VISIBILITY_DEFAULT