summaryrefslogtreecommitdiff
path: root/i/marvin/src/log/log_server.cc
diff options
context:
space:
mode:
Diffstat (limited to 'i/marvin/src/log/log_server.cc')
-rw-r--r--i/marvin/src/log/log_server.cc20
1 files changed, 13 insertions, 7 deletions
diff --git a/i/marvin/src/log/log_server.cc b/i/marvin/src/log/log_server.cc
index bba80f5..126ed66 100644
--- a/i/marvin/src/log/log_server.cc
+++ b/i/marvin/src/log/log_server.cc
@@ -23,26 +23,32 @@
//
// }}}
#include "log_server.hh"
-#include "socket/socket_databuffer.hh"
+#include "socket/socket_client.hh"
-LogServer::LogServer(DataBuffer & db, const Address & address)
- :ss_(address),db_(db)
+LogServer::LogServer(DataInput & di, const Address & address)
+ :ss_(address),di_(di)
{
}
-LogServer::LogServer(DataBuffer & db, const std::string & address,
+LogServer::LogServer(DataInput & di, const std::string & address,
int port)
- :ss_(address, port),db_(db)
+ :ss_(address, port),di_(di)
{
}
void
LogServer::listen(void)
{
+ int charBuffer;
+
+ const unsigned BUFFER_SIZE = 256;
+ // Buffer de taille completement arbitraire
+ uint8_t buffer[BUFFER_SIZE];
// Ouvre les oreilles du socket
ss_.listen(1);
// Attend gentillement une connection
- SocketDataBuffer sdb(ss_);
+ SocketClient sc(ss_);
// Paf on envoie la sauce
- sdb.write(db_);
+ while((charBuffer = di_.read(buffer, BUFFER_SIZE)) != 0)
+ sc.write(buffer, charBuffer);
}