From eaf83e5f2f8ee8889d4d55ee77c6e6f4e75ebba4 Mon Sep 17 00:00:00 2001 From: ambigipathyv Date: Mon, 18 Mar 2024 09:52:55 +0100 Subject: [PATCH] Modified socket set_option function to use socket options --- bakanet/src/bakanet/core/socket.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/bakanet/src/bakanet/core/socket.h b/bakanet/src/bakanet/core/socket.h index 7734a96..cf795b2 100755 --- a/bakanet/src/bakanet/core/socket.h +++ b/bakanet/src/bakanet/core/socket.h @@ -3,6 +3,7 @@ #include #include "ip_address.h" #include "ip_protocol.h" +#include "socket_options.h" namespace Bk::Net { @@ -26,7 +27,7 @@ namespace Bk::Net { virtual std::vector obtain(int size) = 0; template - static bool set_option(Socket& socket, int level, int option_name, const T* option_value) { return setsockopt(socket.get_raw_socket(), level, option_name, (void*)option_value, sizeof(T)) == 0 ? true : false; } + static bool set_option(Socket& socket, OptionLayer level, SocketOption option_name, const T* option_value) { return setsockopt(socket.get_raw_socket(), (int)level, (int)option_name, (void*)option_value, sizeof(T)) == 0 ? true : false; } static std::unique_ptr create(IpAddress ip, int port, IpProtocol proto); protected: