net: add new method Sock::Accept() that wraps accept()

This will help to increase `Sock` usage and make more code mockable.
This commit is contained in:
Vasil Dimov
2021-04-23 09:43:43 +02:00
parent e7507f333b
commit f8bd13f85a
5 changed files with 72 additions and 0 deletions

View File

@@ -410,6 +410,8 @@ public:
int Connect(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;
bool Wait(std::chrono::milliseconds timeout, Event requested, Event* occurred = nullptr) const override;