From: Peng Li Date: Mon, 4 Jun 2018 16:33:15 +0000 (+0800) Subject: init commit X-Git-Url: http://47.100.26.94:8080/?a=commitdiff_plain;h=HEAD;p=SocketWrapper.git init commit --- 0ce1cb3a4ecc54e7e0df692deeb288b9f0ff3f7d diff --git a/TCPServer.cpp b/TCPServer.cpp new file mode 100644 index 0000000..40e2516 --- /dev/null +++ b/TCPServer.cpp @@ -0,0 +1,16 @@ +#include "TCPServer.h" +#include +#include + +TCPServer::TCPServer() +{ +} + +TCPServer::~TCPServer() +{ +} + +void TCPServer::onRecv(const std::stringstream& ss) +{ + std::cout << ss.str() << std::endl; +} diff --git a/TCPServer.h b/TCPServer.h new file mode 100644 index 0000000..b51bc66 --- /dev/null +++ b/TCPServer.h @@ -0,0 +1,11 @@ +#include + +class TCPServer +{ +public: + TCPServer(); + ~TCPServer(); + virtual void onRecv(const std::stringstream& ss); +private: +}; + diff --git a/main.cpp b/main.cpp new file mode 100644 index 0000000..6291375 --- /dev/null +++ b/main.cpp @@ -0,0 +1,16 @@ +#include "TCPServer.h" +#include +#include + +class MyServer : public TCPServer +{ + void onRecv(const std::stringstream& ss){ + std::cout << "wowo" << ss.str() << std::endl; + } +}; + +int main() +{ +//TCPServer server("127.0.0.1", 9999); + MyServer s ; +}