title: Getting ai_socktype not supported
body: <p>I had this working previously, but I didn't understand how, so I'm attempting to rewrite a bit of code.</p>
  
  <p>Everything seems to be going fine, except when I try to use getaddrinfo(), I'm getting back a result of -7, which translates into the error "ai_socktype not supported".</p>
  
  <p>I'm willing to bet it's simply me still getting a handle on pointers. If someone can explain how/where I'm going wrong, I would appreciate it.</p>
  
  <p>The code:</p>
  
  <pre><code>#define PORT "4400"
  typedef struct {
      int port;
      fd_set *connections;
      int connections_count;
      int listener;
      struct addrinfo *address;
      struct addrinfo *socket_hints;
  } Server;
  
  void initialize_server(Server *passed_server, char *port) {
      struct addrinfo *temp;
      int status; // Get addrinfo status
  
      // Set up the server hints
      passed_server-&gt;socket_hints = malloc(sizeof passed_server-&gt;socket_hints);
      passed_server-&gt;socket_hints-&gt;ai_family = AF_UNSPEC;
      passed_server-&gt;socket_hints-&gt;ai_socktype = SOCK_STREAM;
      passed_server-&gt;socket_hints-&gt;ai_flags = AI_PASSIVE;
  
      if((status = getaddrinfo(NULL, port, passed_server-&gt;socket_hints, &amp;temp)) != 0) {
          fprintf(stderr, "Error with getaddrinfo: %s\n", gai_strerror(status));
      }
      printf("Result: %d\n", status);
  }
  
  int main(int argc, char** argv) {
      // Set up socket stuff
      Server *server = malloc(sizeof *server); // Set up the server
      initialize_server(server, PORT);
  
      return (EXIT_SUCCESS);
  }
  </code></pre>