title: BSD sockets and timeouts in iOS
body: <p>I setup a socket option like this:</p>
  
  <pre><code>struct timeval tv;
  tv.tv_sec = 0;
  tv.tv_usec = 0;
  if (setsockopt(sockfd, SOL_SOCKET, SO_RCVTIMEO, &amp;tv, sizeof(tv)) == -1) {
      perror("setsockopt");
      exit(1);
  }
  </code></pre>
  
  <p>When I do this the socket blocks forever on a recv call but when I set tv_usec to 1 the socket timesout as expected.  Is this expected behavior?  Any help in understanding this would be appreciated.</p>