开发者

to find a list of connected server in android device?

开发者 https://www.devze.com 2023-01-05 01:48 出处:网络
Programmability i want monitor IP ever connected to my Adnroid device. My initial thought is i can write a background service which will run tcpdump command and forward its output to inputStream. By

Programmability i want monitor IP ever connected to my Adnroid device.

My initial thought is i can write a background service which will run tcpdump command and forward its output to inputStream. By putting any regular expression i can retrieve list of connected IP to my device.

I think that would be bulky to continually run command like tcpdump.

any better solut开发者_运维百科ion ??

Edit - typo


You'll have to choose how often to run tcpdump, and that'll be tricky - running it more frequently will have a performance impact, but running it less frequently may mean that you miss short-lived connections. Perhaps you could set up a logging "firewall" on your device using iptables ( http://www.linuxquestions.org/questions/linux-security-4/iptables-logging-385165/ ), and then parse the output of THAT whenever you actually need the output?

0

精彩评论

暂无评论...
验证码 换一张
取 消