1 // ANNA - Anna is Not Nothingness Anymore //
3 // (c) Copyright 2005-2015 Eduardo Ramos Testillano & Francisco Ruiz Rayo //
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 //
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>
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>
26 using namespace anna::diameter::comm;
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) {;}
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