summaryrefslogtreecommitdiff
path: root/syncSocket.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'syncSocket.cpp')
-rw-r--r--syncSocket.cpp29
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()