bitz-server  1.0.2
worker.h
1 /*
2  * bitz-server, An ICAP server implementation in C++
3  * Copyright (C) 2012 Uditha Atukorala
4  *
5  * This program is free software; you can redistribute it and/or modify
6  * it under the terms of the GNU General Public License as published by
7  * the Free Software Foundation; either version 3 of the License, or
8  * (at your option) any later version.
9  *
10  * This program is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  * GNU General Public License for more details.
14  *
15  * You should have received a copy of the GNU General Public License
16  * along with this program; if not, write to the Free Software
17  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18  */
19 
20 #ifndef BITZ_WORKER_H
21 #define BITZ_WORKER_H
22 
23 #include <psocksxx/tcpnsockstream.h>
24 
25 #include "common.h"
26 
27 
28 namespace bitz {
29 
30  class Worker {
31  public:
32  Worker();
33  virtual ~Worker();
34 
35  virtual void run( psocksxx::tcpnsockstream * server_sock,
36  unsigned int max_requests, unsigned int comm_timeout = 0 ) throw();
37 
38  private:
39  req_handlers_t _req_handlers;
40 
41  virtual void load_req_handlers() throw();
42  virtual unsigned int serve_client( psocksxx::nsockstream * client_sock, unsigned int max_requests ) throw();
43 
44  };
45 
46 } /* end of namespace bitz */
47 
48 #endif /* !BITZ_WORKER_H */
49 
Definition: echo.cpp:23
Definition: worker.h:30