diff options
Diffstat (limited to 'syncSocket.cpp')
-rw-r--r-- | syncSocket.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/syncSocket.cpp b/syncSocket.cpp index d557bf4..6681ba3 100644 --- a/syncSocket.cpp +++ b/syncSocket.cpp @@ -35,6 +35,9 @@ void SyncSocket::OnAccept() boost::archive::text_oarchive oa(sout); const SyncCommand scom(cl_,cit->first); oa << scom; + std::stringstream lengthout; + lengthout << std::setw(5) << std::setfill('0') << sout.str().size()<< ' '; + Send(lengthout.str()); Send(sout.str()); } //TODO Locking here @@ -46,6 +49,9 @@ void SyncSocket::OnAccept() boost::archive::text_oarchive oa(sout); const SyncCommand scom(tmp); oa << scom; + std::stringstream lengthout; + lengthout << std::setw(5) << std::setfill('0') << sout.str().size()<< ' '; + Send(lengthout.str()); Send(sout.str()); } } |