diff options
author | Othmar Gsenger <otti@anytun.org> | 2008-02-28 21:30:28 +0000 |
---|---|---|
committer | Othmar Gsenger <otti@anytun.org> | 2008-02-28 21:30:28 +0000 |
commit | 8ddb2c09f6cf2e3781ed660aa28f4e68aeeb4fc5 (patch) | |
tree | 7566f560540433674070fe810476a1497c0842ee /syncSocket.cpp | |
parent | removed dummy file (diff) |
new sync protocol
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()); } } |