From a786997f304745ce3766a82be06dc6a5d0c2f02c Mon Sep 17 00:00:00 2001 From: Amlal El Mahrouss Date: Tue, 14 Oct 2025 04:35:26 +0200 Subject: feat: scl: major refactors and new version of SCL. Signed-off-by: Amlal El Mahrouss --- dev/lib/net/modem.hpp | 22 +++++++++++----------- dev/lib/net/url.hpp | 4 ++-- 2 files changed, 13 insertions(+), 13 deletions(-) (limited to 'dev/lib/net') 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 #include #include #include -#include #include -#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 class basic_url; @@ -69,4 +69,4 @@ namespace ocl::net mailto, bad }; -} // namespace ocl::net +} // namespace scl::net -- cgit v1.2.3