[socket] add connect method (#8308)

This commit is contained in:
Kevin Ahrendt
2025-02-25 09:32:54 +13:00
committed by GitHub
parent 96682f5cbe
commit 3410aee42e
3 changed files with 5 additions and 1 deletions
@@ -46,6 +46,7 @@ class BSDSocketImpl : public Socket {
close(); // NOLINT(clang-analyzer-optin.cplusplus.VirtualCall)
}
}
int connect(const struct sockaddr *addr, socklen_t addrlen) override { return ::connect(fd_, addr, addrlen); }
std::unique_ptr<Socket> accept(struct sockaddr *addr, socklen_t *addrlen) override {
int fd = ::accept(fd_, addr, addrlen);
if (fd == -1)