diff options
| author | Amlal El Mahrouss <amlal@nekernel.org> | 2025-10-14 04:35:26 +0200 |
|---|---|---|
| committer | Amlal El Mahrouss <amlal@nekernel.org> | 2025-10-14 04:35:26 +0200 |
| commit | a786997f304745ce3766a82be06dc6a5d0c2f02c (patch) | |
| tree | db923caaec3762fbb68290fd1ae94cb1465378e7 /dev/lib/net | |
| parent | fa4748e414e9494442f9bcde9c659d3951af19c0 (diff) | |
feat: scl: major refactors and new version of SCL.
Signed-off-by: Amlal El Mahrouss <amlal@nekernel.org>
Diffstat (limited to 'dev/lib/net')
| -rw-r--r-- | dev/lib/net/modem.hpp | 22 | ||||
| -rw-r--r-- | dev/lib/net/url.hpp | 4 |
2 files changed, 13 insertions, 13 deletions
diff --git a/dev/lib/net/modem.hpp b/dev/lib/net/modem.hpp index 074f182..69b1aef 100644 --- a/dev/lib/net/modem.hpp +++ b/dev/lib/net/modem.hpp @@ -5,19 +5,18 @@ * Copyright 2025, Amlal El Mahrouss */ -#ifndef _OCL_NET_NETWORK_HPP -#define _OCL_NET_NETWORK_HPP +#ifndef _SCL_NET_NETWORK_HPP +#define _SCL_NET_NETWORK_HPP #include <unistd.h> #include <arpa/inet.h> #include <sys/socket.h> #include <string> -#include <utility> #include <cstddef> -#define OCL_MODEM_INTERFACE : public ocl::net::basic_modem +#define OCL_MODEM_INTERFACE : public scl::net::basic_modem -namespace ocl::net +namespace scl::net { class basic_modem; @@ -130,12 +129,13 @@ namespace ocl::net return ret == 0L; } - ::bind(fd_, (struct sockaddr*)&addr_, sizeof(addr_)); - ::listen(fd_, basic_modem::backlog_count); + int ret = ::bind(fd_, (struct sockaddr*)&addr_, sizeof(addr_)); - bad_ = false; + bad_ = ret == -1; + + ::listen(fd_, basic_modem::backlog_count); - return true; + return bad_ == false; } bool destroy() noexcept @@ -151,6 +151,6 @@ namespace ocl::net return true; } }; -} // namespace ocl::net +} // namespace scl::net -#endif // ifndef _OCL_NET_NETWORK_HPP +#endif // ifndef _SCL_NET_NETWORK_HPP diff --git a/dev/lib/net/url.hpp b/dev/lib/net/url.hpp index 7263a52..3ada418 100644 --- a/dev/lib/net/url.hpp +++ b/dev/lib/net/url.hpp @@ -13,7 +13,7 @@ /// @author Amlal El Mahrouss (amlal@nekernel.org) -namespace ocl::net +namespace scl::net { template <typename char_type> class basic_url; @@ -69,4 +69,4 @@ namespace ocl::net mailto, bad }; -} // namespace ocl::net +} // namespace scl::net |
