title: error: request for member ‘sin_addr’ in something not a structure or union
body: <p>When I compiled the code (found below) on Linux, gcc said:</p>
  
  <blockquote>
    <p>error: request for member ‘sin_addr’ in something not a structure or
    union</p>
  </blockquote>
  
  <p>but I didn't find any problem.</p>
  
  <p>Am I missing anything from the header files, or do I have some syntax errors?</p>
  
  <pre><code>#include &lt;sys/socket.h&gt;
  #include &lt;unistd.h&gt;
  #include &lt;stdio.h&gt;
  #include &lt;netinet/in.h&gt;
  #include &lt;string.h&gt;
  #include &lt;sys/types.h&gt;
  #include &lt;sys/stat.h&gt;
  #include &lt;fcntl.h&gt;
  #include &lt;stdlib.h&gt;
  
  #define _PORT_ 98
  
  char *SerIP = "127.0.0.1";
  char *File;
  
  int main(int argc, char *argv[])
  {
      int Clisock, Sersock;
      struct sockaddr_in SerInfo, CliInfo;
      int filefd, nByte;
      char buf[BUFSIZ];
  
      if(argc &lt; 2)
      {
          fputs("Too less arguments!\n", stderr);
          exit(1);
      }
      memset(&amp;CliInfo, 0, sizeof(CliInfo));
      File = argv[1];
  
      SerInfo.sin_family = AF_INET;
      if(inet_pton(AF_INET, SerIP, &amp;SerIP.sin_addr.s_addr) &lt; 0)
      {
          perror("inet_pton");
          exit(1);
      }
      SerInfo.sin_port = htons(_PORT_);
  
      if ((Clisock = socket(AF_INET, SOCK_STREAM, 0)) &lt; 0)
      {
          perror("scoket");
          exit(1);
      }
  
      if(connect(Clisock, (struct sockaddr*)&amp;SerInfo, sizeof(SerInfo)) &lt; 0)
      {
          perror("connect");
          exit(1);
      }
      while (1)
      {
          filefd = open(File, O_RDONLY);
          while((nByte = read(filefd, buf, BUFSIZ)) &gt; 0)
          {
              if(send(Clisock, buf, nByte, 0) &lt; 0)
              {
                  perror("send");
                  exit(1);
              }
              if(nByte &lt; BUFSIZ)
              {
                  send(Clisock, "END", 3, 0);
                  break;
              }
  
          }
          send(Clisock, "END", 3, 0);
          break;
      }
      close(Clisock);
      close(filefd);
      return 0;
  }
  </code></pre>