net: add new method Sock::Bind() that wraps bind()

This will help to increase `Sock` usage and make more code mockable.
This commit is contained in:
Vasil Dimov
2021-04-13 16:31:04 +02:00
parent 7164e00e1b
commit 3ad7de225e
6 changed files with 36 additions and 2 deletions

View File

@@ -64,6 +64,8 @@ public:
int Connect(const sockaddr*, socklen_t) const override;
int Bind(const sockaddr*, socklen_t) const override;
std::unique_ptr<Sock> Accept(sockaddr* addr, socklen_t* addr_len) const override;
int GetSockOpt(int level, int opt_name, void* opt_val, socklen_t* opt_len) const override;