aboutsummaryrefslogtreecommitdiff
path: root/src/util/sock.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/util/sock.h')
-rw-r--r--src/util/sock.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/util/sock.h b/src/util/sock.h
index 6a7840f4e2..6835757328 100644
--- a/src/util/sock.h
+++ b/src/util/sock.h
@@ -104,6 +104,12 @@ public:
[[nodiscard]] virtual int Bind(const sockaddr* addr, socklen_t addr_len) const;
/**
+ * listen(2) wrapper. Equivalent to `listen(this->Get(), backlog)`. Code that uses this
+ * wrapper can be unit tested if this method is overridden by a mock Sock implementation.
+ */
+ [[nodiscard]] virtual int Listen(int backlog) const;
+
+ /**
* accept(2) wrapper. Equivalent to `std::make_unique<Sock>(accept(this->Get(), addr, addr_len))`.
* Code that uses this wrapper can be unit tested if this method is overridden by a mock Sock
* implementation.