- /** server's host name */
- std::string _host_name;
- /** number of threads to use on the server */
- int _threads;
-};
-
-class Server : public ExceptionStore, public boost::noncopyable
-{
-public:
- Server (boost::shared_ptr<Log> log, bool verbose);
-
- void run (int num_threads);
-
-private:
- void worker_thread ();
- int process (boost::shared_ptr<Socket> socket, struct timeval &, struct timeval &);
- void broadcast_thread ();
- void broadcast_received ();
-
- std::vector<boost::thread *> _worker_threads;
- std::list<boost::shared_ptr<Socket> > _queue;
- boost::mutex _worker_mutex;
- boost::condition _full_condition;
- boost::condition _empty_condition;
- boost::shared_ptr<Log> _log;
- bool _verbose;