MCPcopy Create free account
hub / github.com/OpenTTD/OpenTTD / GetAddressAsString

Method GetAddressAsString

src/network/core/address.cpp:95–98  ·  view source on GitHub ↗

* Get the address as a string, e.g. 127.0.0.1:12345. * @param with_family whether to add the family (e.g. IPvX). * @return the address */

Source from the content-addressed store, hash-verified

93 * @return the address
94 */
95std::string NetworkAddress::GetAddressAsString(bool with_family)
96{
97 return fmt::format(fmt::runtime(GetAddressFormatString(this->GetAddress()->ss_family, with_family)), this->GetHostname(), this->GetPort());
98}
99
100/**
101 * Helper function to resolve without opening a socket.

Callers 10

SendPacketMethod · 0.80
ReceivePacketsMethod · 0.80
HandleUDPPacketMethod · 0.80
ReceiveInvalidPacketMethod · 0.80
ConnectMethod · 0.80
OnResolvedMethod · 0.80
CheckActivityMethod · 0.80
ListenLoopProcFunction · 0.80
GetPeerNameMethod · 0.80

Calls 5

GetAddressMethod · 0.95
GetPortMethod · 0.95
GetAddressFormatStringFunction · 0.85
formatFunction · 0.50
runtimeFunction · 0.50

Tested by

no test coverage detected