title: Get the real size of received packet
body: <p><strong>Usually when sending arbitrarily sized packets, a maximum is established and used as the size of your receive buffer.</strong></p>
  
  <pre><code>#include &lt;winsock2.h&gt;
  
  // Socket Description
  // Hint.ai_family = AF_INET;
  // Hint.ai_socktype = SOCK_DGRAM;
  // Hint.ai_protocol = IPPROTO_UDP;
  
  void Send(int Size)
  {
      char *Data = (char *)malloc(Size);
      sendto(Socket, Data, Size, NULL, Result-&gt;ai_addr, Result-&gt;ai_addrlen)
  }
  
  void Receive()
  {
      const unsigned int MaxDataSize = 1436;
      char *Data = (char *)malloc(MaxDataSize);
      recvfrom(Socket, Data, MaxDataSize, 0, (SOCKADDR*)&amp;RecvAddr, &amp;RecvAddrSize);
  }
  </code></pre>
  
  <p>In this pseudo example, no matter the size of data passed to <code>Send()</code>, our <code>Receive()</code> function always gets it at the maximum size defined.</p>
  
  <p><strong>How can one ascertain the original sent packets size?</strong></p>