nnxx_client.h 693 B

123456789101112131415161718192021222324252627282930313233
  1. //
  2. // Created by zx on 2020/6/10.
  3. //
  4. #ifndef NNXX_TESTS_CLIENT_H
  5. #define NNXX_TESTS_CLIENT_H
  6. #include <nnxx/message.h>
  7. #include <nnxx/message_control.h>
  8. #include <nnxx/socket.h>
  9. #include <nnxx/reqrep.h>
  10. #include <string>
  11. #include <iostream>
  12. #include <nnxx/timeout.h>
  13. #include <nnxx/error.h>
  14. #include "../error_code/error_code.h"
  15. #include <mutex>
  16. class Client {
  17. public:
  18. Client();
  19. virtual ~Client();
  20. Error_manager connect(std::string connect_str);
  21. virtual Error_manager request(std::string request_str, std::string& response,unsigned int timeout);
  22. protected:
  23. bool mb_connect;
  24. nnxx::socket m_socket;
  25. std::mutex m_lock;
  26. };
  27. #endif //NNXX_TESTS_CLIENT_H