+bool TCPServer::disconnect(const std::string& host, const Connection::Port& port) {
+#ifdef DEBUG
+ cerr << __FILE__ << "(" << __LINE__ << ")"
+ << ": disconnect(host = " << host
+ << ", port = " << port << ")" << endl;
+#endif // DEBUG
+ Glib::Mutex::Lock lock(connections_mutex);
+ for (ConnectionList::iterator con = connections.begin();
+ con != connections.end(); con++) {
+ if (((*con)->get_host() == host) && ((*con)->get_port() == port)) {
+ (*con)->finish();
+ return true;
+ }
+ }
+ return false;
+}
+
+/// \todo TODO Hay que reemplazarlo por una lista generica.
+TCPServer::ConnectionInfoList TCPServer::get_connected(void) {
+#ifdef DEBUG
+ cerr << __FILE__ << "(" << __LINE__ << ")"
+ << ": get_connected()" << endl;
+#endif // DEBUG
+ TCPServer::ConnectionInfoList cl;
+ Glib::Mutex::Lock lock(connections_mutex);
+ for (ConnectionList::const_iterator con = connections.begin();
+ con != connections.end(); con++) {
+ TCPServer::ConnectionInfo ci =
+ { (*con)->get_host(), (*con)->get_port() };
+ cl.push_back(ci);
+ }
+ return cl;
+}
+
+} // namespace Server
+
+} // namespace PlaQui
+