diff options
author | Othmar Gsenger <otti@anytun.org> | 2007-12-10 13:24:54 +0000 |
---|---|---|
committer | Othmar Gsenger <otti@anytun.org> | 2007-12-10 13:24:54 +0000 |
commit | 3a776dd970badb0c4343bf3e8f2565553926b817 (patch) | |
tree | 9a2372c4d60869f535e7afeb42a4739e5fd14b0b /syncSocket.cpp | |
parent | replay protection still broken (disabled) (diff) |
added synclistensocket
Diffstat (limited to 'syncSocket.cpp')
-rw-r--r-- | syncSocket.cpp | 29 |
1 files changed, 20 insertions, 9 deletions
diff --git a/syncSocket.cpp b/syncSocket.cpp index 066e5e6..dbb1dfb 100644 --- a/syncSocket.cpp +++ b/syncSocket.cpp @@ -1,38 +1,49 @@ #include "Sockets/Utility.h" #include "syncSocket.h" - - -SyncSocket::SyncSocket(ISocketHandler& h) -:TcpSocket(h) +//#include <boost/archive/text_oarchive.hpp> +//#include <boost/archive/text_iarchive.hpp> +#include <sstream> +#include <iostream> +#include <string> +#include "connectionParam.h" + +SyncSocket::SyncSocket(ISocketHandler& h,ConnectionList & cl) +:TcpSocket(h),cl_(cl) { // initial connection timeout setting and number of retries SetConnectTimeout(12); SetConnectionRetry(5); // Also reconnect broken link - SetReconnect(true); +// SetReconnect(true); } bool SyncSocket::OnConnectRetry() { - return true; +// return true; + return false; } void SyncSocket::OnReconnect() { // ... - Send("Welcome back\r\n"); + //Send("Welcome back\r\n"); } void SyncSocket::OnAccept() { - Send("Local hostname : " + Utility::GetLocalHostname() + "\n"); - Send("Local address : " + Utility::GetLocalAddress() + "\n"); + Send( Utility::GetLocalHostname() + "\n"); + Send( Utility::GetLocalAddress() + "\n"); Send("Number of sockets in list : " + Utility::l2string(Handler().GetCount()) + "\n"); Send("\n"); + std::ostringstream sout; +// boost::archive::text_oarchive oa(sout); + ConnectionParam conn = cl_.getConnection(); + // oa << conn; + Send(sout.str()+"\n"); } //void StatusSocket::InitSSLServer() |