diff options
| author | Amlal El Mahrouss <amlal@nekernel.org> | 2025-11-22 13:11:56 -0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-11-22 13:11:56 -0500 |
| commit | 9a70f32ddaec0eef99efbf7ff5597c2adf08f45a (patch) | |
| tree | 1717d2b24d610b638cb70b12d7db74f15953f1fe /dev/lib/net/modem.hpp | |
| parent | 8470a48ef4c6ea4b16e9a764aaedc7158f9c37ed (diff) | |
| parent | 58dc03a47576601006c4870d1633bf35fc78176a (diff) | |
Merge pull request #17 from amlel-el-mahrouss/develop
feat: library improvements
Diffstat (limited to 'dev/lib/net/modem.hpp')
| -rw-r--r-- | dev/lib/net/modem.hpp | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/dev/lib/net/modem.hpp b/dev/lib/net/modem.hpp index a498f2e..fd64f72 100644 --- a/dev/lib/net/modem.hpp +++ b/dev/lib/net/modem.hpp @@ -5,8 +5,7 @@ * Copyright 2025, Amlal El Mahrouss, licensed under the Boost Software License. */ -#ifndef _OCL_NET_NETWORK_HPP -#define _OCL_NET_NETWORK_HPP +#pragma once #include <lib/tests/hpptest.hpp> @@ -22,13 +21,14 @@ namespace ocl::net { class modem; - using socket_type = int64_t; - /// ============================================================================= /// @brief Modem container concept, a container to read and write on a network stream. /// ============================================================================= class modem final { + public: + using socket_type = int64_t; + private: socket_type fd_{}; bool server_fd_{false}; @@ -145,7 +145,7 @@ namespace ocl::net int ret = ::bind(fd_, (struct sockaddr*)&addr_, sizeof(addr_)); bad_ = ret == -1; - + ::listen(fd_, modem::backlog_count); return bad_ == false; @@ -166,4 +166,3 @@ namespace ocl::net }; } // namespace ocl::net -#endif // ifndef _OCL_NET_NETWORK_HPP |
