Changed LICENSE. Now referenced to web site and file on project root directory
[anna.git] / example / timex / ArithmeticHTTPServer / main.cpp
1 // ANNA - Anna is Not Nothingness Anymore                                                         //
2 //                                                                                                //
3 // (c) Copyright 2005-2015 Eduardo Ramos Testillano & Francisco Ruiz Rayo                         //
4 //                                                                                                //
5 // See project site at http://redmine.teslayout.com/projects/anna-suite                           //
6 // See accompanying file LICENSE or copy at http://www.teslayout.com/projects/public/anna.LICENSE //
7
8
9 #include <iostream>
10
11 #include <anna/core/util/CommandLine.hpp>
12 #include <anna/core/tracing/Logger.hpp>
13 #include <anna/core/tracing/TraceWriter.hpp>
14
15 #include <anna/http/functions.hpp>
16
17 #include "Application.hpp"
18
19 using namespace std;
20 using namespace anna;
21 using namespace test;
22
23 /**
24  * Esta es una implementación de un Gateway que recibe peticiones de operaciones aritméticas
25  * desde un cliente que envía peticiones HTTP y un servidor que atiende peticiones en el protocolo
26  * anna::comm::SureTransport
27  *
28  * Usa la clase anna::timex::Context para gestionar automáticamente toda la creación y liberación
29  * de las transaciones usadas por la aplicación para temporizar las peticiones-respuestas.
30  */
31 int main (int argc, const char** argv)
32 {
33    CommandLine& commandLine (CommandLine::instantiate ());
34    http4comm::Application app;
35
36    http::functions::initialize ();
37
38    try {
39       commandLine.initialize (argv, argc);
40       commandLine.verify ();
41
42       Logger::setLevel (Logger::Debug); 
43       Logger::initialize ("http4comm", new anna::TraceWriter ("file.trace", 4048000));
44  
45       app.start ();
46    }
47    catch (Exception& ex) {
48       cout << ex.asString () << endl;
49    }
50    
51    return 0;
52 }
53