MCPcopy Create free account
hub / github.com/cinience/RedisStudio / Http

Method Http

RedisStudio/Base/Http.cpp:17–32  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

15namespace Base {
16
17Http::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
34Http::~Http()
35{

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected