aozhimin / iOS-Monitor-Platform

:books: iOS 性能监控 SDK —— Wedjat(华狄特)开发过程的调研和整理
https://aozhimin.github.io/iOS-Monitor-Platform/
MIT License
2.6k stars 492 forks source link

网络监控里面为什么不直接hook socket #9

Open hcl416029105 opened 6 years ago

hcl416029105 commented 6 years ago

Network监控里面用到的NSURLConnection,NSURLSession,CFNetwork,最底层还是使用的socket,我们要同时监控NSURLConnection,NSURLSession,CFNetwork。那为什么不直接监控iOS里面的socket呢?

aozhimin commented 6 years ago

@hcl416029105 BSD Socket 函数在 iOS 真机上实际测试下来是没有办法 hook 成功的,参考这个 Issue

aozhimin commented 6 years ago

@liman123 确实不能 hook socket

zhaowq32 commented 6 years ago

那为啥close和send等bsd函数可以被hook成功?