MCPcopy Create free account
hub / github.com/Extra-Creativity/Modern-Cpp-Basics / Socket

Method Socket

08-String & Stream/example/src/Socket.cpp:19–33  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

17{
18
19Socket::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
35Socket::Socket(const Socket &listenSock, Tag tag)
36{

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected