| 17 | { |
| 18 | |
| 19 | Socket::Socket(const char *ip, std::uint16_t port, Tag tag) |
| 20 | { |
| 21 | if (tag == Tag::Listen) |
| 22 | { |
| 23 | CreateListenSocket_(ip, port); |
| 24 | } |
| 25 | else if (tag == Tag::Connect) |
| 26 | { |
| 27 | CreateConnectSocket_(ip, port); |
| 28 | } |
| 29 | else [[unlikely]] |
| 30 | { |
| 31 | throw std::runtime_error{ "Unknown tag.\n" }; |
| 32 | } |
| 33 | } |
| 34 | |
| 35 | Socket::Socket(const Socket &listenSock, Tag tag) |
| 36 | { |
nothing calls this directly
no outgoing calls
no test coverage detected