当前位置: 动力学知识库 > 问答 > 编程问答 >

c++ - Why netstat -o option does not list the chrome tab pid but only its parent browser pid?

问题描述:

Can somebody tell me why netstat -o is listing down only the one browser pid for all the network connections happening inside chrome...what I mean is even if I have 2 or more tabs opened up in chrome and each tab is sending packets , netstat command

netstat -o-b is showing the following.

PROTO LOCAL ADDRESS FOREIGN ADDRESS STATE PID

TCP a.a.a.a b.b.b.b ESTABLISHED 2240 [chrome.exe]

TCP a.a.a.a c.c.c.c ESTABLISHED 2240 [chrome.exe]

2240 is the chrome browser pid.

But the two connections are established

by 2 chrome tabs having distinct pid's of

there own,but are not being listed. Please shed some light.

And more importantly how to get the pid's of each chrome tab programatically?

Note: I am using windows c++.

网友答案:

PID is a Process ID (read: identifier of a running program), not a "Tab ID". The fact that your browser uses tabs is completely irrelevant - your browser (a single program = single PID) may establish many connections. The HTML downloadded by those connections is presented to you in different tabs - that's all. BTW the connections may be terminated after the whole content has been downloaded, but the tab(s) may be still kept open (untill you close them manually). Whether the connections are kept open or not depends on many different factors: the content of the page (if it uses any AJAX, etc.), browser settings.

分享给朋友:
您可能感兴趣的文章:
随机阅读: