Sponge
CS144's user-space TCP library
address_dt.cc
Go to the documentation of this file.
1 #include "address.hh"
2 
3 #include <cstdlib>
4 #include <iostream>
5 #include <stdexcept>
6 
7 int main() {
8  try {
9 #include "address_example_1.cc"
10 #include "address_example_2.cc"
11 #include "address_example_3.cc"
12  if ((google_webserver.port() != 443) || (a_dns_server_numeric != 0x12'47'00'97)) {
13  throw std::runtime_error("unexpected value");
14  }
15  } catch (const std::exception &e) {
16  std::cerr << "This test requires Internet access and working DNS.\n";
17  std::cerr << "Error: " << e.what() << "\n";
18  return EXIT_FAILURE;
19  }
20  return EXIT_SUCCESS;
21 }
int main()
Definition: address_dt.cc:7
const Address google_webserver("www.google.com", "https")
const uint32_t a_dns_server_numeric
uint16_t port() const
Numeric port (host byte order).
Definition: address.hh:53
T what(T... args)