diff options
author | Othmar Gsenger <otti@anytun.org> | 2008-02-28 19:18:30 +0000 |
---|---|---|
committer | Othmar Gsenger <otti@anytun.org> | 2008-02-28 19:18:30 +0000 |
commit | 16156b2acfd23b3f07c4f8df5da26c9c32008338 (patch) | |
tree | 93edd5767fd26693beebaa7be505a5d87fae37fc | |
parent | anymux base (diff) |
added muxSocket
-rw-r--r-- | muxSocket.cpp | 40 | ||||
-rw-r--r-- | muxSocket.h | 23 |
2 files changed, 63 insertions, 0 deletions
diff --git a/muxSocket.cpp b/muxSocket.cpp new file mode 100644 index 0000000..8adfb2b --- /dev/null +++ b/muxSocket.cpp @@ -0,0 +1,40 @@ +#include <sstream> +#include <iostream> +#include <string> + +#include "Sockets/Utility.h" +#include "muxSocket.h" +//#include "log.h" + +#ifdef SOCKETS_NAMESPACE +using namespace SOCKETS_NAMESPACE; +#endif // SOCKETS_NAMESPACE + + +MuxSocket::MuxSocket(ISocketHandler& h) +:TcpSocket(h) +{ + SetConnectTimeout(12); +} + + + +void MuxSocket::OnAccept() +{ + Send( Utility::GetLocalHostname() + "\n"); + Send( Utility::GetLocalAddress() + "\n"); + Send("Number of sockets in list : " + Utility::l2string(Handler().GetCount()) + "\n"); + Send("\n"); + //TODO Locking here +} + +//void StatusSocket::InitSSLServer() +//{ +// InitializeContext("server.pem", "keypwd", SSLv23_method()); +//} +// +// +//void StatusSocket::Init() +//{ +// EnableSSL(); +//} diff --git a/muxSocket.h b/muxSocket.h new file mode 100644 index 0000000..9b431b4 --- /dev/null +++ b/muxSocket.h @@ -0,0 +1,23 @@ +#ifndef _MUXSOCKET_H +#define _MUXSOCKET_H + +#include "Sockets/TcpSocket.h" +#include "Sockets/ISocketHandler.h" + +#ifdef SOCKETS_NAMESPACE +using namespace SOCKETS_NAMESPACE; +#endif // SOCKETS_NAMESPACE + +class MuxSocket : public TcpSocket +{ +public: + MuxSocket(ISocketHandler& ); + + void OnAccept(); +// void Init(); + +// void InitSSLServer(); +}; + + +#endif // _SYNCSOCKET_H |