summaryrefslogtreecommitdiff
path: root/Kernel/Net/Socket.h
diff options
context:
space:
mode:
Diffstat (limited to 'Kernel/Net/Socket.h')
-rw-r--r--Kernel/Net/Socket.h38
1 files changed, 0 insertions, 38 deletions
diff --git a/Kernel/Net/Socket.h b/Kernel/Net/Socket.h
index 3c1d6c261c..72a159c843 100644
--- a/Kernel/Net/Socket.h
+++ b/Kernel/Net/Socket.h
@@ -183,44 +183,6 @@ private:
NonnullRefPtrVector<Socket> m_pending;
};
-template<typename SocketType>
-class SocketHandle {
-public:
- SocketHandle() = default;
-
- SocketHandle(NonnullRefPtr<SocketType>&& socket)
- : m_socket(move(socket))
- {
- if (m_socket)
- m_socket->mutex().lock();
- }
-
- SocketHandle(SocketHandle&& other)
- : m_socket(move(other.m_socket))
- {
- }
-
- ~SocketHandle()
- {
- if (m_socket)
- m_socket->mutex().unlock();
- }
-
- SocketHandle(const SocketHandle&) = delete;
- SocketHandle& operator=(const SocketHandle&) = delete;
-
- operator bool() const { return m_socket; }
-
- SocketType* operator->() { return &socket(); }
- const SocketType* operator->() const { return &socket(); }
-
- SocketType& socket() { return *m_socket; }
- const SocketType& socket() const { return *m_socket; }
-
-private:
- RefPtr<SocketType> m_socket;
-};
-
// This is a special variant of TRY() that also updates the socket's SO_ERROR field on error.
#define SOCKET_TRY(expression) \
({ \