ClientConnection.h 584 B

1234567891011121314151617181920212223242526272829
  1. //
  2. // Created by xcbosa on 2023/1/28.
  3. //
  4. #pragma once
  5. #include "httpserver-private.h"
  6. using namespace std;
  7. namespace xc {
  8. namespace httpserver {
  9. class ClientConnection {
  10. public:
  11. ClientConnection(int sockFd, struct sockaddr_in address);
  12. void workAndDestroy();
  13. private:
  14. int sockFd;
  15. struct sockaddr_in address;
  16. ::FILE *clRead;
  17. ::FILE *clWrite;
  18. char *requestBuff;
  19. void workLoop();
  20. void cleanUpAndDestroy();
  21. };
  22. } // xc
  23. } // httpserver