| 15 | namespace Base { |
| 16 | |
| 17 | Http::Http(const std::string& hostname, int port) |
| 18 | { |
| 19 | struct hostent *remoteHost = gethostbyname(hostname.c_str()); |
| 20 | struct in_addr addr; |
| 21 | _host = hostname; |
| 22 | _port = port; |
| 23 | if (remoteHost != NULL) { |
| 24 | if (remoteHost->h_addrtype == AF_INET) |
| 25 | { |
| 26 | if (remoteHost->h_addr_list[0] != 0) { |
| 27 | addr.s_addr = *(u_long *) remoteHost->h_addr_list[0]; |
| 28 | _ip = inet_ntoa(addr); |
| 29 | } |
| 30 | } |
| 31 | } |
| 32 | } |
| 33 | |
| 34 | Http::~Http() |
| 35 | { |
nothing calls this directly
no outgoing calls
no test coverage detected