Fix local server for multiple applications
[anna.git] / internal / RemoteConnection.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/xml/Node.hpp>
10 #include <anna/xml/Attribute.hpp>
11
12 #include <anna/comm/internal/RemoteConnection.hpp>
13 #include <anna/comm/Server.hpp>
14 #include <anna/comm/ClientSocket.hpp>
15
16 using namespace std;
17 using namespace anna;
18
19 string comm::RemoteConnection::asString() const
20 {
21   string result("comm::RemoteConnection { ");
22   result += anna::functions::asString(a_clientSocket);
23   return result += " }";
24 }
25
26 xml::Node* comm::RemoteConnection::asXML(xml::Node* parent) const
27 noexcept(false) {
28   xml::Node* result = parent->createChild("comm.RemoteConnection");
29
30   if(a_clientSocket != NULL)
31     a_clientSocket->asXML(result);
32
33   return result;
34 }