Get IP and Port from Socket Address.
- Returns
- Returns IP and Port.
Definition at line 36 of file InetAddress.cpp.
37 {
39
40 char buf[64] = { 0 };
41 ::inet_ntop(AF_INET, &
m_Address.sin_addr, buf,
sizeof(buf));
42 const size_t end = strlen(buf);
43 const uint16_t port = ntohs(
m_Address.sin_port);
44 sprintf(buf + end, ":%u", port);
45 return buf;
46 }
#define SPICES_PROFILE_ZONE
sockaddr_in m_Address
Socket Address.
Referenced by Spices::Net::TcpServer::TcpServer().