net: add new method Sock::GetSockName() that wraps getsockname()

This will help to increase `Sock` usage and make more code mockable.
This commit is contained in:
Vasil Dimov
2021-04-13 14:37:16 +02:00
parent 8e7eeb5971
commit 748dbcd9f2
5 changed files with 34 additions and 0 deletions

View File

@@ -69,6 +69,8 @@ public:
int SetSockOpt(int level, int opt_name, const void* opt_val, socklen_t opt_len) const override;
int GetSockName(sockaddr* name, socklen_t* name_len) const override;
bool Wait(std::chrono::milliseconds timeout, Event requested, Event* occurred = nullptr) const override;
bool WaitMany(std::chrono::milliseconds timeout, EventsPerSock& events_per_sock) const override;