MCPcopy Create free account
hub / github.com/SFML/SFML / create

Method create

src/SFML/Network/Socket.cpp:103–120  ·  view source on GitHub ↗

///////////////////////////////////////////////////////

Source from the content-addressed store, hash-verified

101
102////////////////////////////////////////////////////////////
103void Socket::create(IpAddress::Type addressType)
104{
105 // Don't create the socket if it already exists
106 if (m_socket == priv::SocketImpl::invalidSocket())
107 {
108 const SocketHandle handle = socket(addressType == IpAddress::Type::IpV4 ? PF_INET : PF_INET6,
109 m_type == Type::Tcp ? SOCK_STREAM : SOCK_DGRAM,
110 0);
111
112 if (handle == priv::SocketImpl::invalidSocket())
113 {
114 err() << "Failed to create socket" << std::endl;
115 return;
116 }
117
118 create(handle);
119 }
120}
121
122
123////////////////////////////////////////////////////////////

Callers 1

acceptMethod · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected