MCPcopy Create free account
hub / github.com/cuberite/cuberite / BindToLocalhostIPv4

Method BindToLocalhostIPv4

src/OSSupport/Socket.cpp:190–200  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

188
189
190bool cSocket::BindToLocalhostIPv4(unsigned short a_Port)
191{
192 sockaddr_in local;
193 memset(&local, 0, sizeof(local));
194
195 local.sin_family = AF_INET;;
196 local.sin_addr.s_addr = htonl(INADDR_LOOPBACK);
197 local.sin_port = htons((u_short)a_Port);
198
199 return (bind(m_Socket, (sockaddr*)&local, sizeof(local)) == 0);
200}
201
202
203

Callers 1

StartMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected