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.h17
1 files changed, 15 insertions, 2 deletions
diff --git a/src/util/sock.h b/src/util/sock.h
index d923de531f..c4ad0cbc43 100644
--- a/src/util/sock.h
+++ b/src/util/sock.h
@@ -80,16 +80,29 @@ public:
/**
* send(2) wrapper. Equivalent to `send(this->Get(), data, len, flags);`. Code that uses this
- * wrapper can be unit-tested if this method is overridden by a mock Sock implementation.
+ * wrapper can be unit tested if this method is overridden by a mock Sock implementation.
*/
virtual ssize_t Send(const void* data, size_t len, int flags) const;
/**
* recv(2) wrapper. Equivalent to `recv(this->Get(), buf, len, flags);`. Code that uses this
- * wrapper can be unit-tested if this method is overridden by a mock Sock implementation.
+ * wrapper can be unit tested if this method is overridden by a mock Sock implementation.
*/
virtual ssize_t Recv(void* buf, size_t len, int flags) const;
+ /**
+ * connect(2) wrapper. Equivalent to `connect(this->Get(), addr, addrlen)`. Code that uses this
+ * wrapper can be unit tested if this method is overridden by a mock Sock implementation.
+ */
+ virtual int Connect(const sockaddr* addr, socklen_t addr_len) const;
+
+ /**
+ * getsockopt(2) wrapper. Equivalent to
+ * `getsockopt(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.
+ */
+ virtual int GetSockOpt(int level, int opt_name, void* opt_val, socklen_t* opt_len) const;
+
using Event = uint8_t;
/**