summaryrefslogtreecommitdiff
path: root/src/anyCtrSocket.cpp
diff options
context:
space:
mode:
authorChristian Pointner <equinox@anytun.org>2008-04-12 12:38:51 +0000
committerChristian Pointner <equinox@anytun.org>2008-04-12 12:38:51 +0000
commit6f1742b504d08a097f220c5562c02e107dc7af83 (patch)
tree1e659f04f3fd225b4f714636c59e89ae83f8915b /src/anyCtrSocket.cpp
parentanytun-config can add more than one route at once (diff)
cleaned up confusing names for different options
Diffstat (limited to 'src/anyCtrSocket.cpp')
-rw-r--r--src/anyCtrSocket.cpp49
1 files changed, 49 insertions, 0 deletions
diff --git a/src/anyCtrSocket.cpp b/src/anyCtrSocket.cpp
new file mode 100644
index 0000000..d3bec07
--- /dev/null
+++ b/src/anyCtrSocket.cpp
@@ -0,0 +1,49 @@
+#include <sstream>
+#include <iostream>
+#include <fstream>
+#include <string>
+
+#include "anyCtrOptions.h"
+
+#include "Sockets/Utility.h"
+#include "anyCtrSocket.h"
+
+
+#ifdef SOCKETS_NAMESPACE
+using namespace SOCKETS_NAMESPACE;
+#endif // SOCKETS_NAMESPACE
+
+
+MuxSocket::MuxSocket(ISocketHandler& h) : TcpSocket(h), filename_(gOpt.getFileName())
+{
+ SetConnectTimeout(12);
+}
+
+
+void MuxSocket::OnAccept()
+{
+ std::ifstream file(filename_.c_str());
+ if( file.is_open() )
+ {
+ std::string line;
+ while( !file.eof() )
+ {
+ getline( file, line );
+ Send( line );
+ }
+ file.close();
+ }
+
+ //TODO Locking here
+}
+
+//void StatusSocket::InitSSLServer()
+//{
+// InitializeContext("server.pem", "keypwd", SSLv23_method());
+//}
+//
+//
+//void StatusSocket::Init()
+//{
+// EnableSSL();
+//}