25 if (host_name && *host_name) {
28 if (isdigit(*host_name)) {
29 DWORD a = inet_addr(host_name);
30 h = gethostbyaddr((
const char*) &a, 4, AF_INET);
33 h = gethostbyname(host_name);
38 addr = **(DWORD**) (h->h_addr_list);
53 : addr(n.addr), port(n.port)
63 ZeroMemory(&sadr,
sizeof(sadr));
65 sadr.sin_family = AF_INET;
66 sadr.sin_port = ::htons(port);
67 sadr.sin_addr.s_addr = addr;
73 addr = sadr.sin_addr.s_addr;
74 port = ::ntohs(sadr.sin_port);
82 return (sockaddr*) &sadr;
97 ZeroMemory(&sadr,
sizeof(sadr));
99 if (size >
sizeof(sadr))
100 CopyMemory(&sadr, s,
sizeof(sadr));
102 CopyMemory(&sadr, s, size);