title: how to know the server IP address after opening a socket connection in iOS
body: <p>I opened a socket connection. I want to know server IP address</p>
  <pre><code>    NSString *urlString = [NSString stringWithFormat:@&quot;http://sample.com&quot;];
  
      NSURL *website = [NSURL URLWithString:urlString];
      CFReadStreamRef readStream;
      CFWriteStreamRef writeStream;
      CFStreamCreatePairWithSocketToHost(NULL, ( CFStringRef)[website host], [portNo intValue], &amp;readStream, &amp;writeStream);
      
      CFReadStreamSetProperty(readStream,kCFStreamNetworkServiceType,kCFStreamNetworkServiceTypeVoIP);
      CFWriteStreamSetProperty(writeStream,kCFStreamNetworkServiceType,kCFStreamNetworkServiceTypeVoIP);
  
      inputStream = ( NSInputStream *)readStream;
      outputStream = ( NSOutputStream *)writeStream;
      [inputStream open];
      [outputStream open];
  </code></pre>