summaryrefslogtreecommitdiff
path: root/muxSocket.cpp
blob: 629ec45aeb68a181c6c5382604d62c8c1defe377 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
#include <sstream>
#include <iostream>
#include <fstream>
#include <string>

#include "Sockets/Utility.h"
#include "muxSocket.h"

#ifdef SOCKETS_NAMESPACE
using namespace SOCKETS_NAMESPACE;
#endif // SOCKETS_NAMESPACE


MuxSocket::MuxSocket(ISocketHandler& h)
:TcpSocket(h)
{
	SetConnectTimeout(12);
}



void MuxSocket::OnAccept()
{
  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
}

//void StatusSocket::InitSSLServer()
//{
//	InitializeContext("server.pem", "keypwd", SSLv23_method());
//}
//
//
//void StatusSocket::Init()
//{
//	EnableSSL();
//}