MCPcopy Create free account
hub / github.com/MonaSolutions/MonaServer / resolveService

Method resolveService

MonaBase/sources/SocketAddress.cpp:250–261  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

248
249
250UInt16 SocketAddress::resolveService(Exception& ex,const char* service) {
251 UInt16 port=0;
252 if (String::ToNumber<UInt16>(service,port))
253 return port;
254 if (!Net::InitializeNetwork(ex))
255 return 0;
256 struct servent* se = getservbyname(service, NULL);
257 if (se)
258 return ntohs(se->s_port);
259 ex.set(Exception::NETPORT, "Service ", service, " unknown");
260 return 0;
261}
262
263
264const SocketAddress& SocketAddress::Wildcard(IPAddress::Family family) {

Callers

nothing calls this directly

Calls 1

setMethod · 0.45

Tested by

no test coverage detected