diff options
author | Erwin Nindl <nine@wirdorange.org> | 2008-02-28 19:38:57 +0000 |
---|---|---|
committer | Erwin Nindl <nine@wirdorange.org> | 2008-02-28 19:38:57 +0000 |
commit | 832af7990b095ebfc10324f3b94cd614036762ad (patch) | |
tree | e0822dd5cced597ddb744e31348f6b0ddbf2525b /muxSocket.cpp | |
parent | added muxSocket (diff) |
added fileoutput to anymux
Diffstat (limited to 'muxSocket.cpp')
-rw-r--r-- | muxSocket.cpp | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/muxSocket.cpp b/muxSocket.cpp index 8adfb2b..629ec45 100644 --- a/muxSocket.cpp +++ b/muxSocket.cpp @@ -1,10 +1,10 @@ #include <sstream> #include <iostream> +#include <fstream> #include <string> #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 } |