title: c connect() error - invalid argument
body: <p>I'm writing a simple UDP client and an error returned as "invalid argument", but I don't know what's wrong. It is compiled on linux. My code is as below.</p>
  
  <pre><code>int udp_fd = -1;
  struct sockaddr_in addr;
  int port = 1701;
  
  udp_fd = socket(AF_PPPOX, SOCK_DGRAM, 0);
  if (udp_fd &lt; 0) {
      printf("fail to get UDP socket\n");
      return 0;
  }
  
  memset((char *) &amp;addr, 0, sizeof(struct sockaddr_in));
  addr.sin_family = AF_INET;
  addr.sin_addr.s_addr = inet_addr("31.25.210.118");
  addr.sin_port = htons(port);
  
  if(connect(udp_fd, (struct sockaddr *)&amp;addr, sizeof(addr)) &lt; 0 ) {
      printf("UDP connect failed, errno = %s\n", strerror(errno));
      return 0;
  }
  </code></pre>