Fix local server for multiple applications
[anna.git] / comm / internal / LocalConnection.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/core/tracing/TraceMethod.hpp>
10 #include <anna/core/functions.hpp>
11
12 #include <anna/xml/Node.hpp>
13 #include <anna/xml/Attribute.hpp>
14
15 #include <anna/comm/internal/LocalConnection.hpp>
16 #include <anna/comm/ClientSocket.hpp>
17
18 using namespace std;
19 using namespace anna;
20
21 string comm::LocalConnection::asString() const
22 throw() {
23   string result("comm::LocalConnection { ");
24   result += anna::functions::asString(a_clientSocket);
25   return result += " }";
26 }
27
28 // No saca la informacion del ServerSocket por que se invoca desde su asXML.
29 xml::Node* comm::LocalConnection::asXML(xml::Node* parent) const
30 throw(RuntimeException) {
31   xml::Node* result = parent->createChild("comm.LocalConnection");
32
33   if(a_clientSocket != NULL)
34     a_clientSocket->asXML(result);
35
36   return result;
37 }