4 #include "routingTable.h"
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"
16 SyncSocket::SyncSocket(ISocketHandler
& h
,ConnectionList
& 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");
31 ConnectionMap::iterator cit
= cl_
.getBeginUnlocked();
32 for (;cit
!=cl_
.getEndUnlocked();++cit
)
34 std::ostringstream sout
;
35 boost::archive::text_oarchive
oa(sout
);
36 const SyncCommand
scom(cl_
,cit
->first
);
38 std::stringstream lengthout
;
39 lengthout
<< std::setw(5) << std::setfill('0') << sout
.str().size()<< ' ';
40 Send(lengthout
.str());
44 RoutingMap::iterator it
= gRoutingTable
.getBeginUnlocked();
45 for (;it
!=gRoutingTable
.getEndUnlocked();++it
)
47 NetworkPrefix
tmp(it
->first
);
48 std::ostringstream sout
;
49 boost::archive::text_oarchive
oa(sout
);
50 const SyncCommand
scom(tmp
);
52 std::stringstream lengthout
;
53 lengthout
<< std::setw(5) << std::setfill('0') << sout
.str().size()<< ' ';
54 Send(lengthout
.str());
59 //void StatusSocket::InitSSLServer()
61 // InitializeContext("server.pem", "keypwd", SSLv23_method());
65 //void StatusSocket::Init()