diff options
| author | Amlal El Mahrouss <amlal@nekernel.org> | 2025-11-18 07:44:48 +0100 |
|---|---|---|
| committer | Amlal El Mahrouss <amlal@nekernel.org> | 2025-11-18 07:55:34 +0100 |
| commit | 9eec329ebdf4cf079619edb58dbcd78ce42b8626 (patch) | |
| tree | b9b6d442f8a92fea4c8943a1504dba105b133596 /dev/lib/net | |
| parent | ce3ce66e005eb54b315dbc0c78a74e56e2db4191 (diff) | |
feat: lib: error_handler improvements, new method. FIX module improvements.
Signed-off-by: Amlal El Mahrouss <amlal@nekernel.org>
Diffstat (limited to 'dev/lib/net')
| -rw-r--r-- | dev/lib/net/modem.hpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/dev/lib/net/modem.hpp b/dev/lib/net/modem.hpp index 80b3b7a..7c07191 100644 --- a/dev/lib/net/modem.hpp +++ b/dev/lib/net/modem.hpp @@ -8,6 +8,8 @@ #ifndef _OCL_NET_NETWORK_HPP #define _OCL_NET_NETWORK_HPP +#include <lib/tests/hpptest.hpp> + #include <unistd.h> #include <arpa/inet.h> #include <sys/socket.h> @@ -110,6 +112,10 @@ namespace ocl::net static_assert(af != 0, "Address family is zero"); static_assert(kind != 0, "Kind is zero"); + must_pass<af == AF_INET || af == AF_INET6>(); + must_pass<kind == SOCK_STREAM || kind == SOCK_DGRAM>(); + must_pass<(port > 0) && (port < 65536)>(); + fd_ = ::socket(af, kind, 0); server_fd_ = is_server; |
