summaryrefslogtreecommitdiff
path: root/syncClientSocket.cpp
diff options
context:
space:
mode:
authorOthmar Gsenger <otti@anytun.org>2008-02-28 20:33:46 +0000
committerOthmar Gsenger <otti@anytun.org>2008-02-28 20:33:46 +0000
commit2dd4b9e3a34c3c94fd475de7472e7244e83a48fa (patch)
treef4a13055c9b4672138344dd45488018229acc69b /syncClientSocket.cpp
parentremoved newlines from muxsocket (diff)
sync fixes
Diffstat (limited to 'syncClientSocket.cpp')
-rw-r--r--syncClientSocket.cpp12
1 files changed, 7 insertions, 5 deletions
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<len;index++)
{
std::cout << buf[index];
- iss << buf[index];
+ iss_ << buf[index];
}
- boost::archive::text_iarchive ia(iss);
- SyncCommand scom(cl_);
- ia >> 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 #"<<mux<<" remote host " << conn.remote_host_ << ":" << conn.remote_port_ << std::endl;