From 0b6d2c2c6e866ff9f2ff095003d8299291446f4d Mon Sep 17 00:00:00 2001 From: Othmar Gsenger Date: Wed, 12 Dec 2007 16:14:44 +0000 Subject: added full sync support (max 2 anycast servers) --- syncSocket.cpp | 31 +++++++++++++++++++++++-------- 1 file changed, 23 insertions(+), 8 deletions(-) (limited to 'syncSocket.cpp') diff --git a/syncSocket.cpp b/syncSocket.cpp index f22ad21..5db5fbd 100644 --- a/syncSocket.cpp +++ b/syncSocket.cpp @@ -9,6 +9,8 @@ //#include "connectionParam.h" #include "Sockets/Utility.h" #include "syncSocket.h" +#include "buffer.h" +//#include "log.h" SyncSocket::SyncSocket(ISocketHandler& h,ConnectionList & cl) :TcpSocket(h),cl_(cl) @@ -47,18 +49,31 @@ void SyncSocket::OnAccept() boost::archive::text_oarchive oa(sout); const ConnectionParam conn = cl_.getConnection(); oa << conn; - Send(sout.str()); + Send(sout.str()+"\n"); } } -void SyncSocket::OnRawData(const char *buf,size_t len) +//void SyncSocket::OnRawData(const char *buf,size_t len) +void SyncSocket::OnLine(const std::string& line) { - std::cout << "recieved sync inforamtaion:"<< std::endl; - for(size_t index=0;indexinit(::Buffer(), ::Buffer()); + ConnectionParam conn ( (*kd), (*seq), seq_nr_, "", 0); + ia >> conn; + std::cout << "sync connection remote host " << conn.remote_host_ << ":" << conn.remote_port_ << std::endl; + cl_.clear(); + cl_.addConnection(conn,std::string("default")); } //void StatusSocket::InitSSLServer() //{ -- cgit v1.2.3