2
#ifndef _XMLRPCTHREADEDSERVER_H_
3
#define _XMLRPCTHREADEDSERVER_H_
5
// XmlRpc++ Copyright (c) 2002-2003 by Chris Morley
8
# pragma warning(disable:4786) // identifier was truncated in debug info
17
#include "XmlRpcMutex.h"
18
#include "XmlRpcServer.h"
19
#include "XmlRpcThread.h"
24
//! A class to handle multiple simultaneous XML RPC requests
25
class XmlRpcThreadedServer : public XmlRpcServer {
28
//! Create a server object with a specified number of worker threads.
29
XmlRpcThreadedServer(int nWorkers = 6) : _workers(nWorkers) {}
36
//! Each client request is assigned to one worker to handle.
37
//! Workers are executed on separate threads, and one worker may be
38
//! responsible for dispatching events to multiple client connections.
39
class Worker : XmlRpcRunnable {
41
//! Constructor. Executes the run method in a separate thread.
42
Worker() { _thread.setRunnable(this); _thread.start(); }
44
//! Implement the Runnable interface
49
//! The thread this worker is running in.
56
std::vector<Worker> _workers;
59
//! Serialize dispatcher access
63
}; // class XmlRpcThreadedServer
67
#endif // _XMLRPCTHREADEDSERVER_H_