From 3a776dd970badb0c4343bf3e8f2565553926b817 Mon Sep 17 00:00:00 2001 From: Othmar Gsenger Date: Mon, 10 Dec 2007 13:24:54 +0000 Subject: added synclistensocket --- syncSocket.cpp | 29 ++++++++++++++++++++--------- 1 file changed, 20 insertions(+), 9 deletions(-) (limited to 'syncSocket.cpp') 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 +//#include +#include +#include +#include +#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() -- cgit v1.2.3