diff options
Diffstat (limited to 'Kernel/Net/Socket.h')
-rw-r--r-- | Kernel/Net/Socket.h | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/Kernel/Net/Socket.h b/Kernel/Net/Socket.h index e0a53a6f99..c45f1a2865 100644 --- a/Kernel/Net/Socket.h +++ b/Kernel/Net/Socket.h @@ -30,6 +30,7 @@ #include <AK/NonnullRefPtrVector.h> #include <AK/RefCounted.h> #include <AK/RefPtr.h> +#include <AK/Time.h> #include <Kernel/FileSystem/File.h> #include <Kernel/KResult.h> #include <Kernel/Lock.h> @@ -106,7 +107,7 @@ public: virtual bool is_local() const { return false; } virtual bool is_ipv4() const { return false; } virtual KResultOr<size_t> sendto(FileDescription&, const UserOrKernelBuffer&, size_t, int flags, Userspace<const sockaddr*>, socklen_t) = 0; - virtual KResultOr<size_t> recvfrom(FileDescription&, UserOrKernelBuffer&, size_t, int flags, Userspace<sockaddr*>, Userspace<socklen_t*>, timeval&) = 0; + virtual KResultOr<size_t> recvfrom(FileDescription&, UserOrKernelBuffer&, size_t, int flags, Userspace<sockaddr*>, Userspace<socklen_t*>, Time&) = 0; virtual KResult setsockopt(int level, int option, Userspace<const void*>, socklen_t); virtual KResult getsockopt(FileDescription&, int level, int option, Userspace<void*>, Userspace<socklen_t*>); @@ -127,11 +128,11 @@ public: virtual KResult stat(::stat&) const override; virtual String absolute_path(const FileDescription&) const override = 0; - bool has_receive_timeout() const { return m_receive_timeout.tv_sec || m_receive_timeout.tv_usec; } - const timeval& receive_timeout() const { return m_receive_timeout; } + bool has_receive_timeout() const { return m_receive_timeout != Time::zero(); } + const Time& receive_timeout() const { return m_receive_timeout; } - bool has_send_timeout() const { return m_send_timeout.tv_sec || m_send_timeout.tv_usec; } - const timeval& send_timeout() const { return m_send_timeout; } + bool has_send_timeout() const { return m_send_timeout != Time::zero(); } + const Time& send_timeout() const { return m_send_timeout; } bool wants_timestamp() const { return m_timestamp; } @@ -170,8 +171,8 @@ private: RefPtr<NetworkAdapter> m_bound_interface { nullptr }; - timeval m_receive_timeout { 0, 0 }; - timeval m_send_timeout { 0, 0 }; + Time m_receive_timeout {}; + Time m_send_timeout {}; int m_timestamp { 0 }; NonnullRefPtrVector<Socket> m_pending; |