从主机名获取服务器IP地址 [英] Obtaining a server IP address from hostname
本文介绍了从主机名获取服务器IP地址的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
当对主机名执行 NSURLRequest
时,是否可以获取响应来自的服务器的IP地址?
When performing an NSURLRequest
to a hostname, is it possible to obtain the IP address of the server that the response came from?
NSURL
方法:
- (NSString *)host;
只返回主机名,我看不到从任何其他 NSURL
方法。
simply returns the hostname, and I see no way of obtaining the IP address from any of the other NSURL
methods.
也许有一种方法可以在启动 NSURLRequest