title: iOS timeout of ping and ttl
body: <p>I want make ping with timeout and TTL. I use code by Apple (<a href="http://developer.apple.com/library/mac/#samplecode/SimplePing/Introduction/Intro.html" rel="nofollow noreferrer">"Simple Ping"</a>). I read it 
  <a href="https://stackoverflow.com/questions/7437643/ios-ping-with-timeout">"iOS ping with timeout"</a>. I change code:</p>
  
  <pre><code>CFSocketNativeHandle sock = CFSocketGetNative(self-&gt;_socket);
  struct timeval tv;
  tv.tv_sec  = 0;
  tv.tv_usec = 100000; // 0.1 sec
  setsockopt(sock, SOL_SOCKET, SO_SNDTIMEO, (void *)&amp;tv, sizeof(tv));
  
  bytesSent = sendto(
      sock,
      [packet bytes],
      [packet length], 
      0, 
      (struct sockaddr *) [self.hostAddress bytes], 
      (socklen_t) [self.hostAddress length]
  );
  </code></pre>
  
  <p>But I don't understand where I should put code that will show me timeout of receiving packets. Also I need to make ping with TTL (time-to-live) information. I want get information based on this pattern: <code>icmp_seq=count from=ip_address ttl=value_of_ttl time=value_of_replytime_ms</code></p>