Fix bug in json to xml convert library
[anna.git] / source / diameter.comm / ServerSocket.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 <anna/diameter.comm/ServerSocket.hpp>
10 #include <anna/diameter.comm/LocalServer.hpp>
11 #include <anna/diameter.comm/Transport.hpp>
12 #include <anna/core/functions.hpp>
13
14 #include <anna/core/tracing/Logger.hpp>
15 #include <anna/core/tracing/TraceMethod.hpp>
16 #include <anna/comm/ClientSocket.hpp>
17 #include <anna/core/functions.hpp>
18
19 // STL
20 #include <string>
21
22
23 #include <iostream>
24
25
26 using namespace anna::diameter::comm;
27
28 ServerSocket::ServerSocket(const anna::comm::INetAddress &localAddress, LocalServer *localServer) :
29   anna::comm::ServerSocket(localAddress, true /* shared bind */, &anna::diameter::comm::Transport::getFactory()),
30   a_localServer(localServer) {;}
31
32
33 bool ServerSocket::eventAcceptConnection(const anna::comm::ClientSocket &clientSocket) throw(anna::RuntimeException) {
34   LOGMETHOD(anna::TraceMethod tttm("anna::diameter::comm::ServerSocket", "eventAcceptConnection", ANNA_FILE_LOCATION));
35   a_localServer->createServerSession(clientSocket);
36 //   // Aprovecho para hacer el purgado de idle() + deprecated, y así me evito un temporizador de purgado:
37 //   a_localServer->eraseDeprecatedIdleServerSessions();
38   // Always accept: we control by mean closing/listening on server socket
39   return true;
40 }
41
42