title: Where is wrong with my STUN Binding request
body: <p>I send udp request to <code>stun.l.google.com:19305</code>, but I don't get any response from google stun server. I omit all of the error check in this piece of code. My program hang in <code>recvfrom</code>.</p>
  
  <pre><code>int stun_socket = socket(AF_INET, SOCK_DGRAM, 0);
  
  struct sockaddr_in stun_client;
  memset(&amp;stun_client, 0, sizeof(stun_client));
  
  stun_client.sin_family = AF_INET;
  stun_client.sin_port = htons(local_port);
  
  int rc = bind(stun_socket, (struct sockaddr *)&amp;stun_client, sizeof(stun_client));
  
  struct sockaddr_in stun_server;
  memset(&amp;stun_server, 0, sizeof(stun_server));
  
  stun_server.sin_family = AF_INET;
  stun_server.sin_port = htons(remote_port);
  inet_pton(AF_INET, server, &amp;stun_server.sin_addr);
  
  typedef struct stun_header_tag {
      uint16_t message_type;
      uint16_t message_length;
      unsigned char transaction_id[16];
  } stun_header_t;
  
  stun_header_t header;
  header.message_type = htons(0x0001); /* Binding Request */
  header.message_length = htons(0);
  *(int *)(&amp;header.transaction_id[8]) = 0xFFEEFFEE; /* transaction id in the response should keep consistent with this one */
  
  rc = sendto(stun_socket, (void *)&amp;header, sizeof(header), 0, (struct sockaddr *)&amp;stun_server, sizeof(stun_server));
  
  char response[64];
  rc = recvfrom(stun_socket, response, 64, 0, NULL, 0);
  </code></pre>