/*
 * Copyright ©2026 Soham Pardeshi. All rights reserved.
 * Permission is hereby granted to students registered for University of
 * Washington CSE 333 for use solely during Summer Quarter 2026 for
 * purposes of the course. No other use, copying, distribution, or
 * modification is permitted without prior written consent. Copyrights
 * for third-party components of this work must be honored. Instructors
 * interested in reusing these course materials should contact the author.
 */

/* WARNING! Don't just blindly copy code -- check to see if you need to make
 * any tweaks to do exactly what you want it to.
 * You should also NOT assume that this sample code has perfect style.
 */

#include <arpa/inet.h>  // for socket(), AF_INT, SOCK_STREAM
#include <unistd.h>     // for close()

#include <cstdlib>      // for EXIT_SUCCESS, EXIT_FAILURE
#include <cstring>      // for strerror()
#include <iostream>     // for std::cerr, std::endl

int main(int argc, char** argv) {
  int socket_fd = socket(AF_INET, SOCK_STREAM, 0);
  if (socket_fd == -1) {
     std::cerr << strerror(errno) << std::endl;
     return EXIT_FAILURE;
  }
  close(socket_fd);
  return EXIT_SUCCESS;
}