4 #include "routingTable.h"
5 #include "rtpSessionTable.h"
6 #include <boost/archive/text_oarchive.hpp>
7 #include <boost/archive/text_iarchive.hpp>
10 //#include "connectionParam.h"
11 #include "Sockets/Utility.h"
12 #include "syncSocket.h"
13 #include "syncCommand.h"
17 SyncSocket::SyncSocket(ISocketHandler
& h
,ConnectionList
& cl
)
20 SetConnectTimeout(12);
25 void SyncSocket::OnAccept()
27 // Send( Utility::GetLocalHostname() + "\n");
28 // Send( Utility::GetLocalAddress() + "\n");
29 // Send("Number of sockets in list : " + Utility::l2string(Handler().GetCount()) + "\n");
32 ConnectionMap::iterator cit
= cl_
.getBeginUnlocked();
33 for (;cit
!=cl_
.getEndUnlocked();++cit
)
35 std::ostringstream sout
;
36 boost::archive::text_oarchive
oa(sout
);
37 const SyncCommand
scom(cl_
,cit
->first
);
39 std::stringstream lengthout
;
40 lengthout
<< std::setw(5) << std::setfill('0') << sout
.str().size()<< ' ';
41 Send(lengthout
.str());
45 RoutingMap::iterator it
= gRoutingTable
.getBeginUnlocked();
46 for (;it
!=gRoutingTable
.getEndUnlocked();++it
)
48 NetworkPrefix
tmp(it
->first
);
49 std::ostringstream sout
;
50 boost::archive::text_oarchive
oa(sout
);
51 const SyncCommand
scom(tmp
);
53 std::stringstream lengthout
;
54 lengthout
<< std::setw(5) << std::setfill('0') << sout
.str().size()<< ' ';
55 Send(lengthout
.str());
59 RtpSessionMap::iterator rit
= gRtpSessionTable
.getBeginUnlocked();
60 for (;rit
!=gRtpSessionTable
.getEndUnlocked();++rit
)
62 std::ostringstream sout
;
63 boost::archive::text_oarchive
oa(sout
);
64 const SyncCommand
scom(rit
->first
);
66 std::stringstream lengthout
;
67 lengthout
<< std::setw(5) << std::setfill('0') << sout
.str().size()<< ' ';
68 Send(lengthout
.str());
73 //void StatusSocket::InitSSLServer()
75 // InitializeContext("server.pem", "keypwd", SSLv23_method());
79 //void StatusSocket::Init()