1234567891011121314151617181920212223242526272829303132 |
- //
- // Created by zx on 2020/6/10.
- //
- #ifndef NNXX_TESTS_NNXX_SERVER_H
- #define NNXX_TESTS_NNXX_SERVER_H
- #include <nnxx/message.h>
- #include <nnxx/message_control.h>
- #include <nnxx/socket.h>
- #include <nnxx/reqrep.h>
- #include <string>
- #include <iostream>
- #include <thread>
- class Server {
- public:
- Server();
- ~Server();
- bool bind(std::string connect_str);
- bool service_response(nnxx::message& message,nnxx::message_control& c1);
- protected:
- static void service_handle(Server* pServer);
- protected:
- std::thread* m_service_thread;
- nnxx::socket m_socket;
- bool mb_close;
- };
- #endif //NNXX_TESTS_NNXX_SERVER_H
|