libt2n: (tomj) doxygen support
[libt2n] / src / server.cpp
index b749afa..2e2b337 100644 (file)
@@ -60,6 +60,13 @@ server::~server()
         delete i->second;
 }
 
+/**
+    Gets a connection by id
+    
+    \param conn_id Connection ID
+    
+    \retval Pointer to connection object
+*/
 connection* server::get_connection(unsigned int conn_id)
 {
     std::map<unsigned int, connection*>::iterator p=connections.find(conn_id);
@@ -76,6 +83,14 @@ void server::check_timeout()
         i->second->check_timeout();
 }
 
+void server::fill_connection_buffers(void)
+{
+    std::map<unsigned int, connection*>::iterator ie=connections.end();
+    for(std::map<unsigned int, connection*>::iterator i=connections.begin(); i != ie; i++)
+        if (!i->second->is_closed())
+            i->second->fill_buffer();
+}
+
 bool server::get_packet(std::string& data, unsigned int& conn_id)
 {
     // todo: this is somehow unfair: the first connections in the map get checked more