1 // ANNA - Anna is Not Nothingness Anymore
3 // (c) Copyright 2005-2014 Eduardo Ramos Testillano & Francisco Ruiz Rayo
5 // http://redmine.teslayout.com/projects/anna-suite
7 // Redistribution and use in source and binary forms, with or without
8 // modification, are permitted provided that the following conditions
11 // * Redistributions of source code must retain the above copyright
12 // notice, this list of conditions and the following disclaimer.
13 // * Redistributions in binary form must reproduce the above
14 // copyright notice, this list of conditions and the following disclaimer
15 // in the documentation and/or other materials provided with the
17 // * Neither the name of the copyright holder nor the names of its
18 // contributors may be used to endorse or promote products derived from
19 // this software without specific prior written permission.
21 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
22 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
23 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
24 // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
25 // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
26 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
27 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
28 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
29 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
30 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
31 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
33 // Authors: eduardo.ramos.testillano@gmail.com
34 // cisco.tierra@gmail.com
37 #include <anna/diameter.comm/OamModule.hpp>
38 #include <anna/diameter.comm/Engine.hpp>
39 #include <anna/diameter.comm/LocalServer.hpp>
40 #include <anna/diameter.comm/ServerSession.hpp>
41 #include <anna/diameter.comm/ServerSocket.hpp>
42 #include <anna/core/functions.hpp>
43 #include <anna/statistics/Engine.hpp>
44 #include <anna/diameter.comm/TimerManager.hpp>
46 #include <anna/core/tracing/Logger.hpp>
47 #include <anna/core/tracing/TraceMethod.hpp>
48 #include <anna/core/functions.hpp>
49 #include <anna/app/functions.hpp>
50 #include <anna/xml/Node.hpp>
51 #include <anna/comm/Communicator.hpp>
52 #include <anna/comm/Network.hpp>
53 #include <anna/comm/Host.hpp>
54 #include <anna/comm/ClientSocket.hpp>
61 using namespace anna::diameter::comm;
63 LocalServer::LocalServer() :
67 a_currentConnections(0),
68 a_allowedInactivityTime(ServerSession::DefaultAllowedInactivityTime),
74 a_lastUsedResource(NULL) {
75 a_statisticsAccumulator.reset();
79 void LocalServer::initializeStatisticConcepts() throw() {
81 anna::statistics::Engine& statsEngine = anna::statistics::Engine::instantiate();
82 // Concepts descriptions:
83 std::string serverAsString = anna::functions::socketLiteralAsString(a_key.first, a_key.second);
84 std::string c1desc = "Diameter processing time (for requests) at clients connected to "; c1desc += serverAsString;
85 std::string c2desc = "Diameter message sizes received from clients connected to "; c2desc += serverAsString;
87 a_processing_time__StatisticConceptId = statsEngine.addConcept(c1desc.c_str(), "ms", true/* integer values */);
88 a_received_message_size__StatisticConceptId = statsEngine.addConcept(c2desc.c_str(), "bytes", true/* integer values */);
91 void LocalServer::resetStatistics() throw() {
92 a_statisticsAccumulator.reset();
95 void LocalServer::updateProcessingTimeStatisticConcept(const double &value) throw() {
96 a_statisticsAccumulator.process(a_processing_time__StatisticConceptId, value);
97 LOGDEBUG(anna::Logger::debug(a_statisticsAccumulator.asString(), ANNA_FILE_LOCATION));
100 void LocalServer::updateReceivedMessageSizeStatisticConcept(const double &value) throw() {
101 a_statisticsAccumulator.process(a_received_message_size__StatisticConceptId, value);
102 //LOGDEBUG(anna::Logger::debug(a_statisticsAccumulator.asString(), ANNA_FILE_LOCATION));
106 ServerSession* LocalServer::allocateServerSession() throw() { return a_serverSessionsRecycler.create(); }
107 void LocalServer::releaseServerSession(ServerSession *serverSession) throw() { a_serverSessionsRecycler.release(serverSession); }
110 LocalServer::serverSession_iterator LocalServer::serverSession_find(const serverSession_key &key) throw() {
111 return a_serverSessions.find(key);
115 LocalServer::serverSession_key LocalServer::getServerSessionKey(const anna::comm::ClientSocket &clientSocket) const throw() {
116 return (anna::functions::exclusiveHash(clientSocket.getRemoteAccessPoint().getINetAddress().serialize()));
120 void LocalServer::availabilityLost() throw() {
122 std::string socket = anna::functions::socketLiteralAsString(a_key.first, a_key.second);
124 std::string msg = "diameter::comm::LocalServer { Socket: ";
126 msg += " } has lost its availability";
127 anna::Logger::debug(msg, ANNA_FILE_LOCATION);
130 OamModule &oamModule = OamModule::instantiate();
131 oamModule.activateAlarm(OamModule::Alarm::c_LostAvailabilityOverLocalServerDefinedAs__s__, socket.c_str());
132 oamModule.count(OamModule::Counter::LostAvailabilityOverLocalServer);
133 a_engine->availabilityLost(this);
134 a_engine->refreshAvailabilityForLocalServers();
138 void LocalServer::availabilityRecovered() throw() {
140 std::string socket = anna::functions::socketLiteralAsString(a_key.first, a_key.second);
142 std::string msg = "diameter::comm::LocalServer { Socket: ";
144 msg += " } has recovered its availability";
145 anna::Logger::debug(msg, ANNA_FILE_LOCATION);
148 OamModule &oamModule = OamModule::instantiate();
149 oamModule.cancelAlarm(OamModule::Alarm::c_LostAvailabilityOverLocalServerDefinedAs__s__, socket.c_str());
150 oamModule.count(OamModule::Counter::RecoveredAvailabilityOverLocalServer);
151 a_engine->availabilityRecovered(this);
152 a_engine->refreshAvailabilityForLocalServers();
157 bool LocalServer::refreshAvailability() throw() {
159 if(a_available) { // check not-bound state for all server-sessions:
160 // bool isolate = true;
162 // for (const_serverSession_iterator it = serverSession_begin(); it != serverSession_end(); it++)
163 // if (serverSession(it)->getState() != ServerSession::State::Closed) { isolate = false; break; }
166 // El problema de lo anterior, es que cuando se acepta una conexion, aun no ha llegado el CER (receive). Un server session
167 // esta en estado "Bound" cuando llega dicho CER y consecuentemente envio un CEA. Nos basaremos en 'a_currentConnections':
168 if(a_currentConnections == 0) {
176 // Here not available
177 // for (const_serverSession_iterator it = serverSession_begin(); it != serverSession_end(); it++)
178 // if (serverSession(it)->getState() == ServerSession::State::Bound) {
179 if(a_currentConnections > 0) { // really == 0
180 availabilityRecovered();
188 void LocalServer::enable(bool unlock) throw(anna::RuntimeException) {
190 if(unlock) a_lock = false;
194 if(a_serverSocket && a_serverSocket->isOpened()) return; // communicator attach twice gets poll bad file descriptor and application stops !
196 // Resolve local address:
197 anna::comm::Network& network = anna::comm::Network::instantiate();
199 anna::comm::Host *host = network.resolve(a_key.first /* addr */);
200 const anna::comm::Device *device = *(host->device_begin());
201 anna::comm::INetAddress localAddress(device, a_key.second /* port */);
202 // Create server socket and assign receiver factory
203 a_serverSocket = new ServerSocket(localAddress, this);
204 a_serverSocket->setCategory(a_category);
208 void LocalServer::attach() throw() {
210 // Attach to communicator
211 anna::comm::Communicator * communicator = anna::app::functions::component <anna::comm::Communicator> (ANNA_FILE_LOCATION);
212 communicator->attach((anna::comm::ServerSocket*)a_serverSocket); // invokes handler insert and then initialize -> server socket bind (*)
214 OamModule &oamModule = OamModule::instantiate();
215 oamModule.count(OamModule::Counter::ServerSocketsOpened);
216 } catch(anna::RuntimeException& ex) {
217 ex.trace(); // fails on (*) (i.e. Address already in use), within communicator attach
219 a_serverSocket->close();
223 void LocalServer::attachPlanning() throw() {
224 LOGMETHOD(anna::TraceMethod tttm("diameter::comm::LocalServer", "attachPlanning", ANNA_FILE_LOCATION));
227 TimerManager::instantiate().createTimer(this);
228 } catch(anna::RuntimeException& ex) {
230 anna::Logger::error("CAPTURED EXCEPTION activating attachPlanning timer", ANNA_FILE_LOCATION);
235 void LocalServer::disable(bool lock) throw(anna::RuntimeException) {
238 anna::comm::Communicator * communicator = anna::app::functions::component <anna::comm::Communicator> (ANNA_FILE_LOCATION);
239 communicator->detach((anna::comm::ServerSocket*)a_serverSocket);
240 //delete(a_serverSocket);
242 OamModule &oamModule = OamModule::instantiate();
243 oamModule.count(OamModule::Counter::ServerSocketsClosed);
247 void LocalServer::lostConnection() throw() {
248 a_currentConnections--;
253 void LocalServer::newConnection() throw(anna::RuntimeException) {
254 a_currentConnections++;
257 if(a_currentConnections == a_maxConnections) {
258 LOGWARNING(anna::Logger::warning("The maximum number of connections allowed over diameter server socket have already been served", ANNA_FILE_LOCATION));
262 // Inform local server (availability changes):
263 bool changes = refreshAvailability();
265 OamModule &oamModule = OamModule::instantiate();
266 oamModule.count(OamModule::Counter::CreatedConnectionForServerSession);
271 ServerSession *LocalServer::createServerSession(const anna::comm::ClientSocket &clientSocket) throw(anna::RuntimeException) {
272 LOGMETHOD(anna::TraceMethod tttm("diameter::comm::LocalServer", "createServerSession", ANNA_FILE_LOCATION));
273 ServerSession* result(NULL);
274 // First erase deprecated ones:
275 std::vector<const ServerSession*> deprecated_server_sessions;
276 const ServerSession* ss;
278 for(const_serverSession_iterator it = serverSession_begin(); it != serverSession_end(); it++) {
279 ss = serverSession(it);
282 deprecated_server_sessions.push_back(ss);
285 std::vector<const ServerSession*>::iterator dc_ncit;
286 std::vector<const ServerSession*>::iterator dc_min(deprecated_server_sessions.begin());
287 std::vector<const ServerSession*>::iterator dc_max(deprecated_server_sessions.end());
288 serverSession_iterator ii;
290 for(dc_ncit = dc_min; dc_ncit != dc_max; dc_ncit++) {
291 ii = serverSession_find((*dc_ncit)->getSocketId());
292 a_serverSessions.erase(ii);
295 // End erase deprecated server sessions
297 if((result = allocateServerSession()) == NULL)
298 throw anna::RuntimeException("diameter::comm::LocalServer::allocateServerSession returns NULL", ANNA_FILE_LOCATION);
301 result->initialize(); // warning: recycler does not initialize its objects and at least...
302 // Assignments (it could be done at allocate):
303 serverSession_key key = getServerSessionKey(clientSocket);
304 result->setAllowedInactivityTime(getAllowedInactivityTime());
305 result->setClientSocket((anna::comm::ClientSocket*)(&clientSocket));
306 result->a_parent = this;
307 result->a_socketId = key; // de momento...
308 result->initializeSequences(); // después de asignar el LocalServer y el socketId (*)
309 // (*) Las secuencias se basan en la semilla: srand(::time(NULL) + anna::functions::exclusiveHash(anna::functions::asString("%s:%d|%d", getAddress().c_str(), getPort(), a_socketId)));
310 result->a_engine = a_engine;
311 a_serverSessions.insert(serverSession_value_type(key, result));
313 a_deliveryIterator = serverSession_begin();
319 void LocalServer::closeServerSession(ServerSession* serverSession)
320 throw(anna::RuntimeException) {
321 if(serverSession == NULL)
325 std::string msg("diameter::comm::LocalServer::closeServerSession | ");
326 msg += serverSession->asString();
327 // msg += " | Destroy: ";
328 // msg += (destroy ? "yes" : "no");
329 anna::Logger::debug(msg, ANNA_FILE_LOCATION);
331 serverSession_iterator ii = serverSession_find(serverSession->getSocketId());
333 if(ii == serverSession_end())
337 //serverSession->setState(ServerSession::State::Closing); NOT MANAGED WITH SERVER SESSIONS
338 serverSession->unbind(true /* always forceDisconnect on server sessions ... */);
339 releaseServerSession(serverSession);
340 } catch(anna::RuntimeException& ex) {
344 //a_serverSessions.erase(ii); // IMPORTANTE: posible fuente de cores de este tipo, en relacion con ServerSession::finalize() => delete(this)
345 // #0 0x0000003ca1c2e26d in raise () from /lib64/tls/libc.so.6
347 // #0 0x0000003ca1c2e26d in raise () from /lib64/tls/libc.so.6
348 // #1 0x0000003ca1c2fa6e in abort () from /lib64/tls/libc.so.6
349 // #2 0x0000003ca8cb1148 in __gnu_cxx::__verbose_terminate_handler () from /usr/lib64/libstdc++.so.6
350 // #3 0x0000003ca8caf176 in __cxa_call_unexpected () from /usr/lib64/libstdc++.so.6
351 // #4 0x0000003ca8caf1a3 in std::terminate () from /usr/lib64/libstdc++.so.6
352 // #5 0x0000003ca8caf1b6 in std::terminate () from /usr/lib64/libstdc++.so.6
353 // #6 0x0000003ca8caf0c8 in __cxa_call_unexpected () from /usr/lib64/libstdc++.so.6
354 // #7 0x000000000047a4a7 in anna::diameter::comm::LocalServer::lostConnection (this=0x8aeb10) at comm.db/diameter.comm.LocalServer.cc:200
355 // #8 0x000000000047a9e6 in anna::diameter::comm::LocalServer::closeServerSession (this=0x8aeb10, serverSession=0xc37a00)
356 // at comm.db/diameter.comm.LocalServer.cc:275
357 // #9 0x000000000048d288 in anna::diameter::comm::ServerSession::finalize (this=0xc37a00) at comm.db/diameter.comm.ServerSession.cc:510
358 // #10 0x0000000000494e4f in anna::diameter::comm::ServerSessionReceiver::eventBreakLocalConnection (this=0xc119c0, clientSocket=@0xb0ea00)
359 // SOLUCION: no borrar aqui, marcar como "deprecated". Este estado no se necesita realmente puesto que nadie volvera a usar este recurso.
360 // Pero simplemente se podria usar para purgar mediante temporizacion (entonces sà se harÃa el erase)
361 serverSession->a_deprecated = true;
362 // WE WILL ERASE AT createServerSession
363 a_deliveryIterator = serverSession_begin();
368 ServerSession* LocalServer::findServerSession(int socketId, anna::Exception::Mode::_v emode)
369 throw(anna::RuntimeException) {
370 serverSession_iterator ii = serverSession_find(socketId);
372 if(ii != serverSession_end())
373 return serverSession(ii);
375 if(emode != anna::Exception::Mode::Ignore) {
376 std::string msg("diameter::comm::LocalServer::findServerSession | SocketId: ");
377 msg += anna::functions::asString(socketId);
378 msg += " | ServerSession not found";
379 anna::RuntimeException ex(msg, ANNA_FILE_LOCATION);
381 if(emode == anna::Exception::Mode::Throw)
390 ServerSession* LocalServer::findServerSession(const anna::comm::ClientSocket &clientSocket, anna::Exception::Mode::_v emode)
391 throw(anna::RuntimeException) {
392 return findServerSession(getServerSessionKey(clientSocket), emode);
396 int LocalServer::getOTARequests() const throw() {
399 for(const_serverSession_iterator it = serverSession_begin(); it != serverSession_end(); it++)
400 result += serverSession(it)->getOTARequests();
405 void LocalServer::close() throw(anna::RuntimeException) {
406 LOGMETHOD(anna::TraceMethod tttm("diameter::comm::LocalServer", "close", ANNA_FILE_LOCATION));
407 // Close listener (permanently to avoid reopening when local connections are being deleted):
408 disable(true /* lock */);
410 for(serverSession_iterator it = serverSession_begin(); it != serverSession_end(); it++)
411 closeServerSession(serverSession(it));
415 void LocalServer::setMaxConnections(int maxConnections) throw(anna::RuntimeException) {
416 LOGMETHOD(anna::TraceMethod tttm("anna::diameter::comm::LocalServer", "setMaxConnections", ANNA_FILE_LOCATION));
418 // Negative & initial
419 if(maxConnections < 0) {
420 LOGDEBUG(anna::Logger::debug("Provided negative value means no limit accepting connections over server socket. Opening listen port (if closed)...", ANNA_FILE_LOCATION));
421 a_maxConnections = -1;
427 if(maxConnections == a_maxConnections) {
428 LOGDEBUG(anna::Logger::debug("Provided equal to current. Ignore operation", ANNA_FILE_LOCATION));
433 if(maxConnections < a_currentConnections) {
434 std::string msg = "There are more current connections (";
435 msg += anna::functions::entriesAsString(a_currentConnections);
436 msg += ") than provided maximum (";
437 msg += anna::functions::entriesAsString(maxConnections);
438 msg += "). Command rejected (you should release connections before logical limitation)";
439 throw anna::RuntimeException(msg, ANNA_FILE_LOCATION);
443 if(maxConnections > a_currentConnections) {
444 LOGDEBUG(anna::Logger::debug("Increasing connection margin (new limit is greater than current connections). Opening listen port (if closed)...", ANNA_FILE_LOCATION));
446 } else { // maxConnections == a_currentConnections: listen port must be closed if it is opened
449 if(maxConnections == 0)
450 anna::Logger::debug("Provided zero value means disabling diameter server", ANNA_FILE_LOCATION);
451 anna::Logger::debug("Zeroing connections margin (new limit is equal to current connections). Closing listen port (if opened)...", ANNA_FILE_LOCATION);
459 std::string msg("Updating max connections from ");
460 msg += (a_maxConnections == -1) ? "'no limit'" : anna::functions::asString(a_maxConnections);
462 msg += (maxConnections == -1) ? "'no limit'" : anna::functions::asString(maxConnections);
463 anna::Logger::debug(msg, ANNA_FILE_LOCATION);
466 a_maxConnections = maxConnections;
470 bool LocalServer::send(const Message* message, int socketId) throw(anna::RuntimeException) {
471 LOGMETHOD(anna::TraceMethod tttm("diameter::comm::LocalServer", "send", ANNA_FILE_LOCATION));
475 std::string msg = "The local server ";
477 if(a_description != "") {
479 msg += a_description;
482 msg += "is currently unavailable (no server sessions to send the message)";
483 anna::Logger::warning(msg, ANNA_FILE_LOCATION);
488 if(socketId != -1) { // socket id provided
489 // Send (it was a request because of key (socketId) != -1, we forward the answer):
491 ServerSession * fixedServerSession = a_engine->findServerSession(socketId); // exception if not found
492 fixedServerSession->send(message);
494 } catch(anna::RuntimeException &ex) {
495 std::string msg = "Cannot deliver answer through a fixed server session (socket id ";
496 msg += anna::functions::asString(socketId);
497 msg += "). Perhaps it existed but not now. Ignore";
498 anna::Logger::error(msg, ANNA_FILE_LOCATION);
504 // Socket is not provided: use readSocketId
505 socketId = (a_currentConnections > 1) ? readSocketId(message) : -1; // optimization
507 if(a_deliveryIterator == serverSession_end()) a_deliveryIterator = serverSession_begin();
509 a_lastUsedResource = (*a_deliveryIterator).second;
512 a_lastUsedResource = findServerSession(socketId); // exception if not found
513 } else { // Round Robin delivery between client-sessions
514 if(getCurrentConnections() != 1) { // optimize
515 // Next server-session:
516 a_deliveryIterator++;
522 const Response* response = a_lastUsedResource->send(message);
523 return true; // no matter if response is NULL (answers, i.e.) or not.
524 } catch(anna::RuntimeException &ex) {
528 // Here, sent has failed:
530 OamModule &oamModule = OamModule::instantiate();
531 std::string socket = anna::functions::socketLiteralAsString(getKey().first, getKey().second);
532 oamModule.activateAlarm(OamModule::Alarm::UnableToDeliverDiameterMessageToClientFromLocalServer__s__, socket.c_str());
533 oamModule.count(OamModule::Counter::UnableToDeliverToClient);
538 bool LocalServer::broadcast(const Message* message) throw(anna::RuntimeException) {
539 LOGMETHOD(anna::TraceMethod tttm("diameter::comm::LocalServer", "broadcast", ANNA_FILE_LOCATION));
540 const Response* response;
543 for(serverSession_iterator it = serverSession_begin(); it != serverSession_end(); it++) {
545 response = serverSession(it)->send(message);
546 } catch(anna::RuntimeException &ex) {
555 void LocalServer::eventPeerShutdown(const ServerSession* serverSession) throw() {
557 std::string msg(serverSession->asString());
558 msg += " | eventPeerShutdown";
559 anna::Logger::warning(msg, ANNA_FILE_LOCATION);
563 std::string LocalServer::asString() const throw() {
564 std::string result("diameter::comm::LocalServer { ");
565 result += "Description: ";
566 result += (a_description != "") ? a_description : "undefined";
567 result += " | Available (any server session bound): ";
568 result += a_available ? "yes" : "no";
569 result += " | Max Connections: ";
570 result += anna::functions::asString(a_maxConnections);
571 result += " | Current Connections: ";
572 result += anna::functions::asString(a_currentConnections);
573 // Current connections ??
574 result += " | Allowed inactivity time for server sessions: ";
575 result += a_allowedInactivityTime.asString();
576 result += " | Server socket: ";
577 result += a_serverSocket ? a_serverSocket->asString() : "closed";
578 result += anna::functions::asString(" | OTA requests: %d%s", getOTARequests(), idle() ? " (idle)" : "");
579 result += " | Last Incoming Activity Time: ";
580 result += a_lastIncomingActivityTime.asString();
581 result += " | Last Outgoing Activity Time: ";
582 result += a_lastOutgoingActivityTime.asString();
584 // result += a_statisticsAccumulator.asString();
585 // ServerSessions only in xml
586 return result += " }";
590 anna::xml::Node* LocalServer::asXML(anna::xml::Node* parent) const throw() {
591 anna::xml::Node* result = parent->createChild("diameter.LocalServer");
592 result->createAttribute("Description", (a_description != "") ? a_description : "undefined");
593 result->createAttribute("Available", a_available ? "yes" : "no");
594 result->createAttribute("MaxConnections", a_maxConnections);
595 result->createAttribute("CurrentConnections", a_currentConnections);
596 // Current connections ??
597 result->createAttribute("AllowedInactivityTimeForServerSessions", a_allowedInactivityTime.asString());
600 a_serverSocket->asXML(result);
602 result->createAttribute("ServerSocket", "closed");
604 result->createAttribute("OTArequests", anna::functions::asString("%d%s", getOTARequests(), idle() ? " (idle)" : ""));
605 result->createAttribute("LastIncomingActivityTime", a_lastIncomingActivityTime.asString());
606 result->createAttribute("LastOutgoingActivityTime", a_lastOutgoingActivityTime.asString());
608 anna::xml::Node* stats = result->createChild("Statistics");
609 a_statisticsAccumulator.asXML(stats);
610 anna::xml::Node* serverSessions = result->createChild("ServerSessions"); // LocalServer.ServerSessions
612 for(const_serverSession_iterator it = serverSession_begin(); it != serverSession_end(); it++)
613 serverSession(it)->asXML(serverSessions);
618 //------------------------------------------------------------------------------
619 //------------------------------------ LocalServer::updateIncomingActivityTime()
620 //------------------------------------------------------------------------------
621 void LocalServer::updateIncomingActivityTime() throw() {
622 a_lastIncomingActivityTime = anna::functions::millisecond();
625 std::string msg = "Updated INCOMING activity on local server (milliseconds unix): ";
626 msg += anna::functions::asString(a_lastIncomingActivityTime.getValue());
627 anna::Logger::debug(msg, ANNA_FILE_LOCATION);
632 //------------------------------------------------------------------------------
633 //------------------------------------ LocalServer::updateOutgoingActivityTime()
634 //------------------------------------------------------------------------------
635 void LocalServer::updateOutgoingActivityTime(void) throw() {
636 a_lastOutgoingActivityTime = anna::functions::millisecond();
639 std::string msg = "Updated OUTGOING activity on local server (milliseconds unix): ";
640 msg += anna::functions::asString(a_lastOutgoingActivityTime.getValue());
641 anna::Logger::debug(msg, ANNA_FILE_LOCATION);