+ /**
+ * Virtual method for reading a socket option returning integer
+ * value, which is the most typical case. Convenient for overriding
+ * and mocking.
+ *
+ * @param level same as the "level" parameter in getsockopt().
+ * @param optname same as the "optname" parameter in getsockopt().
+ * @param optval same as "optval" parameter in getsockopt().
+ * @param optlen same as "optlen" parameter in getsockopt().
+ * @return same as the return value of getsockopt().
+ */
+ virtual int
+ getSockOptVirtual(int level, int optname, void* optval, socklen_t* optlen) {
+ return getsockopt(fd_, level, optname, optval, optlen);
+ }
+
+ /**
+ * Virtual method for setting a socket option accepting integer
+ * value, which is the most typical case. Convenient for overriding
+ * and mocking.
+ *
+ * @param level same as the "level" parameter in setsockopt().
+ * @param optname same as the "optname" parameter in setsockopt().
+ * @param optval same as "optval" parameter in setsockopt().
+ * @param optlen same as "optlen" parameter in setsockopt().
+ * @return same as the return value of setsockopt().
+ */
+ virtual int setSockOptVirtual(
+ int level,
+ int optname,
+ void const* optval,
+ socklen_t optlen) {
+ return setsockopt(fd_, level, optname, optval, optlen);
+ }
+