title: getaddrinfo() fails continuously with EAI_AGAIN
body: <p>In my code I am using the code as follows.</p>
  
  <pre><code>do
  {
      r = getaddrinfo(host, service, &amp;hints, ret);
  }
  while (r == EAI_AGAIN);
  </code></pre>
  
  <p>when testing getaddrinfo() continuously fails thus loop not terminates properly.</p>
  
  <p>Do you see any way to improve the code? can we use counter to count for number of times it should loop?</p>
  
  <p>Also please let me know for what are all the reasons "EAI_AGAIN" returned by getaddrinfo() call.</p>