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.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/util/sock.h b/src/util/sock.h
index 7510482857..dd2913a66c 100644
--- a/src/util/sock.h
+++ b/src/util/sock.h
@@ -115,6 +115,16 @@ public:
void* opt_val,
socklen_t* opt_len) const;
+ /**
+ * setsockopt(2) wrapper. Equivalent to
+ * `setsockopt(this->Get(), level, opt_name, opt_val, opt_len)`. Code that uses this
+ * wrapper can be unit tested if this method is overridden by a mock Sock implementation.
+ */
+ [[nodiscard]] virtual int SetSockOpt(int level,
+ int opt_name,
+ const void* opt_val,
+ socklen_t opt_len) const;
+
using Event = uint8_t;
/**