summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--syncClientSocket.cpp4
-rw-r--r--syncClientSocket.h1
2 files changed, 3 insertions, 2 deletions
diff --git a/syncClientSocket.cpp b/syncClientSocket.cpp
index 34a23f0..09faeda 100644
--- a/syncClientSocket.cpp
+++ b/syncClientSocket.cpp
@@ -14,7 +14,7 @@
SyncClientSocket::SyncClientSocket(ISocketHandler& h,ConnectionList & cl)
-:TcpSocket(h),cl_(cl)
+:TcpSocket(h),cl_(cl),missing_chars(0)
{
// initial connection timeout setting and number of retries
SetConnectTimeout(12);
@@ -49,7 +49,7 @@ void SyncClientSocket::OnRawData(const char *buf,size_t len)
iss_ << buf[index];
}
- while(!iss_.eof() && !iss_.fail())
+ while(iss_.good())
{
boost::archive::text_iarchive ia(iss_);
SyncCommand scom(cl_);
diff --git a/syncClientSocket.h b/syncClientSocket.h
index 1909ebb..5334079 100644
--- a/syncClientSocket.h
+++ b/syncClientSocket.h
@@ -26,6 +26,7 @@ public:
private:
ConnectionList & cl_;
std::stringstream iss_;
+ uint16_t missing_chars;
};