diff options
| author | littleblack111 <littleblack11111@gmail.com> | 2025-06-12 21:41:41 +0800 |
|---|---|---|
| committer | littleblack111 <littleblack11111@gmail.com> | 2025-06-13 20:22:51 +0800 |
| commit | 6f7b994684032060f0a2d7af82f4f3572293b8d6 (patch) | |
| tree | 793d328cbcd6761365267550b55db45aee9b21fc /src/core/server.hpp | |
| parent | 6a51ab4525c59e9fe2bdbd92493019b0a98c6b94 (diff) | |
internal!: organized internal structure, using cmake now
Diffstat (limited to 'src/core/server.hpp')
| -rw-r--r-- | src/core/server.hpp | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/src/core/server.hpp b/src/core/server.hpp new file mode 100644 index 0000000..c42192b --- /dev/null +++ b/src/core/server.hpp @@ -0,0 +1,19 @@ +#pragma once + +#include "../misc/FileDescriptor.hpp" +#include <memory> +#include <netinet/in.h> + +class CServer { + public: + CServer(uint16_t port); + ~CServer(); + std::shared_ptr<CFileDescriptor> getSocket() const; + + private: + std::shared_ptr<CFileDescriptor> m_sockfd; + sockaddr_in m_addr; + + mutable std::mutex m_mutex; +}; +inline std::unique_ptr<CServer> g_pServer; |
