I need to get the current request's connect server IP address when I use NSURLSession
.
What are the methods available?
I am trying to use
-(void)URLSession:(NSURLSession *)session task:(NSURLSessionTask *)task didFinishCollectingMetrics:(NSURLSessionTaskMetrics *)metrics
but it doesn’t seem to have the target IP address.
Supplement for How can I get the exactly ip address which used to connect in iOS?:
My demand is to monitor network performance in an existing project ,so not be able to replace NSURLsesion
with CFNetwork
.
Or can anyone tell me how to hook or use the lower level direction?
Thanks in advance !