sorry for last ceckin :(
[anytun.git] / syncSocket.cpp
blob647644137356d99c333bfc0f6419a9b15d9972f5
1 #include <sstream>
2 #include <iostream>
3 #include <string>
5 #include <boost/archive/text_oarchive.hpp>
6 #include <boost/archive/text_iarchive.hpp>
9 //#include "connectionParam.h"
10 #include "Sockets/Utility.h"
11 #include "syncSocket.h"
12 #include "syncCommand.h"
13 #include "buffer.h"
14 //#include "log.h"
16 SyncSocket::SyncSocket(ISocketHandler& h,ConnectionList & cl)
17 :TcpSocket(h),cl_(cl)
19 SetConnectTimeout(12);
24 void SyncSocket::OnAccept()
26 // Send( Utility::GetLocalHostname() + "\n");
27 // Send( Utility::GetLocalAddress() + "\n");
28 // Send("Number of sockets in list : " + Utility::l2string(Handler().GetCount()) + "\n");
29 // Send("\n");
30 if( ! cl_.empty())
32 std::ostringstream sout;
33 boost::archive::text_oarchive oa(sout);
34 const SyncCommand scom(cl_,0);
35 oa << scom;
36 Send(sout.str());
40 //void StatusSocket::InitSSLServer()
41 //{
42 // InitializeContext("server.pem", "keypwd", SSLv23_method());
43 //}
46 //void StatusSocket::Init()
47 //{
48 // EnableSSL();
49 //}