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 #ifndef anna_comm_internal_LocalConnection_hpp
10 #define anna_comm_internal_LocalConnection_hpp
28 Implementa los socket locales, es decir, conexiones aceptadas por los ServerSocket que
29 estan activos en nuestra aplicacion.
31 class LocalConnection {
36 LocalConnection() : a_serverSocket(NULL), a_clientSocket(NULL) {;}
39 Devuelve el servidor de socket a partir del cual se cre este socket cliente.Puede ser NULL si este
40 socket cliente no est�asociado a ningn servidor de sockets.
41 \return El servidor de socket a partir del cual se cre este socket cliente.
43 ServerSocket* getServerSocket() const throw() { return a_serverSocket; }
46 Devuelve el socket cliente asociado a esta conexion. Puede ser NULL si la conexion no ha sido establecida.
47 \return El socket cliente asociado a esta conexion.
49 ClientSocket* getClientSocket() throw() { return a_clientSocket; }
52 Devuelve una cadena con la informacin referente a este socket.
53 \return Una cadena con la informacin referente a este socket.
55 std::string asString() const throw();
58 Devuelve un nodo XML con la informacin referente a este objeto.
59 \param parent Nodo XML a partir del cual introducir la informacin.
60 \return Un nodo XML con la informacin referente a este objeto.
62 xml::Node* asXML(xml::Node* parent) const throw(RuntimeException);
65 Devuelve el nombre logico de esta clase.
66 \return el nombre logico de esta clase.
68 static const char* className() throw() { return "anna::comm::LocalConnection"; }
71 ServerSocket* a_serverSocket;
72 ClientSocket* a_clientSocket;
74 void setServerSocket(ServerSocket* serverSocket) throw() { a_serverSocket = serverSocket; }
75 void setClientSocket(ClientSocket* clientSocket) throw() { a_clientSocket = clientSocket; }
77 friend class ServerSocket;
78 friend class handler::ServerSocket;