Menu

[r6]: / framework / trunk / main.cpp  Maximize  Restore  History

Download this file

61 lines (39 with data), 925 Bytes

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
#include <boost/scoped_array.hpp>
#include <pthread.h>
#include <sstream>
#include "cgicc/Cgicc.h"
#include "cgicc/HTTPHTMLHeader.h"
#include "cgicc/HTMLClasses.h"
#include "fcgio.h"
#include "main_thread.h"
#include "thread_pool.h"
using namespace std;
using namespace boost;
int global_counter = 0;
All_Configuration config = { "localhost","root","root","cppcms" };
int main(int argc,char **argv)
{
char *socket="/tmp/php-fastcgi.socket";
try{
//#define SS
#ifdef SS
FastCGI_ST<Main_Thread> app(socket);
app.execute();
cout<<"Finished\n";
# else
int n=5;
FastCGI_MT<Main_Thread> app(n,socket);
app.execute();
long long const *stats=app.get_stats();
int i;
for(i=0;i<n;i++){
cout<<"Thread "<<i<<" executed "<<stats[i]<< " times\n";
}
cout<<"Finished\n"<<global_counter<<endl;
#endif
}
catch(HTTP_Error &s) {
cerr<<s.get()<<endl;
}
return 0;
}
MongoDB Logo MongoDB