From 2dd4b9e3a34c3c94fd475de7472e7244e83a48fa Mon Sep 17 00:00:00 2001 From: Othmar Gsenger Date: Thu, 28 Feb 2008 20:33:46 +0000 Subject: sync fixes --- anyctr.cpp | 5 ++++- syncClientSocket.cpp | 12 +++++++----- syncClientSocket.h | 6 ++++++ 3 files changed, 17 insertions(+), 6 deletions(-) diff --git a/anyctr.cpp b/anyctr.cpp index 51b79aa..5eb8add 100644 --- a/anyctr.cpp +++ b/anyctr.cpp @@ -89,8 +89,11 @@ void createConnection(const std::string & remote_host, u_int16_t remote_port, Co const SyncCommand scom(cl,mux); const SyncCommand scom2 (prefix); oa << scom; - oa << scom2; std::cout << sout.str() << std::endl; + std::ostringstream sout2; + boost::archive::text_oarchive oa2(sout2); + oa2 << scom2; + std::cout << sout2.str() << std::endl; } int main(int argc, char* argv[]) diff --git a/syncClientSocket.cpp b/syncClientSocket.cpp index 734ff6e..40954c4 100644 --- a/syncClientSocket.cpp +++ b/syncClientSocket.cpp @@ -42,17 +42,19 @@ void SyncClientSocket::OnReconnect() void SyncClientSocket::OnRawData(const char *buf,size_t len) //void SyncClientSocket::OnLine(const std::string& line) { - std::stringstream iss; cLog.msg(Log::PRIO_NOTICE) << "recieved sync inforamtaion from " << GetRemoteHostname() << std::endl; for(size_t index=0;index> scom; + while(!iss_.fail()) + { + boost::archive::text_iarchive ia(iss_); + SyncCommand scom(cl_); + ia >> scom; + } //u_int16_t mux = scom.getMux(); //const ConnectionParam & conn = cl_.getConnection(mux)->second; //cLog.msg(Log::PRIO_NOTICE) << "sync connection #"< +#include +#include + + #ifdef SOCKETS_NAMESPACE using namespace SOCKETS_NAMESPACE; @@ -20,6 +25,7 @@ public: void OnRawData(const char *buf,size_t len); private: ConnectionList & cl_; + std::stringstream iss_; }; -- cgit v1.2.3