From 832af7990b095ebfc10324f3b94cd614036762ad Mon Sep 17 00:00:00 2001 From: Erwin Nindl Date: Thu, 28 Feb 2008 19:38:57 +0000 Subject: added fileoutput to anymux --- muxSocket.cpp | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) (limited to 'muxSocket.cpp') diff --git a/muxSocket.cpp b/muxSocket.cpp index 8adfb2b..629ec45 100644 --- a/muxSocket.cpp +++ b/muxSocket.cpp @@ -1,10 +1,10 @@ #include #include +#include #include #include "Sockets/Utility.h" #include "muxSocket.h" -//#include "log.h" #ifdef SOCKETS_NAMESPACE using namespace SOCKETS_NAMESPACE; @@ -21,10 +21,20 @@ MuxSocket::MuxSocket(ISocketHandler& h) void MuxSocket::OnAccept() { - Send( Utility::GetLocalHostname() + "\n"); - Send( Utility::GetLocalAddress() + "\n"); - Send("Number of sockets in list : " + Utility::l2string(Handler().GetCount()) + "\n"); + std::string filename("testoutput.txt"); + std::ifstream file(filename.c_str()); + if( file.is_open() ) + { + std::string line; + while( !file.eof() ) + { + getline( file, line ); + Send( line + "\n" ); + } + file.close(); + } Send("\n"); + //TODO Locking here } -- cgit v1.2.3