We're calling on all EU-based Mozillians with iOS or iPadOS devices to help us monitor Apple’s new browser choice screens. Join the effort to hold Big Tech to account!

搜索 | 用户支持

防范以用户支持为名的诈骗。我们绝对不会要求您拨打电话或发送短信,及提供任何个人信息。请使用“举报滥用”选项报告涉及违规的行为。

详细了解

Why do ports stay connected after I leave a website?

  • 5 个回答
  • 1 人有此问题
  • 9 次查看
  • 最后回复者为 JohnCorliss

more options

I'm using the current version of Firefox in Windows XP SP3. For some time now, I've been using Nirsoft's "Currports", which displays the current connected ports, the program using them, the remote host name, etc. If a port has been disconnected and moved to a wait state, it also displays that.

What I've been noticing is that while using Firefox to surf the internet, when I leave a website, often the ports that website was using will remain connected! And I'm not talking about ports which change to a wait state. An example of such a website (and there are many) which does this is:

http://www.reuters.com/news/us

Even worse, a while ago I closed Firefox completely and when I looked at Currports, I noticed that FOUR ports, with Firefox listed as the program which was using them, were still connected! Yet when I looked in Sysinternal's "Process Explorer", Firefox wasn't listed as still running. I expected the ports to close shortly after I had initially viewed them, but 30 seconds later they were still open! I had to use Currports to close them.

When I leave a website, all port connections to that website should close for security reasons. I can't think of any good reason for ports to remain open and connected after I stop looking at a website.

Has anybody else noticed such things? And if this is a common occurrence, why does it happen? Why should a website remain connected to my computer after I leave it?

I'm using the current version of Firefox in Windows XP SP3. For some time now, I've been using Nirsoft's "Currports", which displays the current connected ports, the program using them, the remote host name, etc. If a port has been disconnected and moved to a wait state, it also displays that. What I've been noticing is that while using Firefox to surf the internet, when I leave a website, often the ports that website was using will remain connected! And I'm not talking about ports which change to a wait state. An example of such a website (and there are many) which does this is: http://www.reuters.com/news/us Even worse, a while ago I closed Firefox completely and when I looked at Currports, I noticed that FOUR ports, with Firefox listed as the program which was using them, were still connected! Yet when I looked in Sysinternal's "Process Explorer", Firefox wasn't listed as still running. I expected the ports to close shortly after I had initially viewed them, but 30 seconds later they were still open! I had to use Currports to close them. When I leave a website, all port connections to that website should close for security reasons. I can't think of any good reason for ports to remain open and connected after I stop looking at a website. Has anybody else noticed such things? And if this is a common occurrence, why does it happen? Why should a website remain connected to my computer after I leave it?

所有回复 (5)

more options

Hi, Yes I have noticed that this happens in the Litbeam tool as well.

I did try to refresh the page, however some updated and others did not. There is another about:networking page that shows the open connected websockets. One way to disconnect from these are refreshing the list and seeing if they are active or not. The none active ones are just cached.

more options

guigs, thanks for replying. Not only can I use Currports to view connected ports, I can use that same program to disconnect them. You select the connected port or ports and then left click on the big red "X". Kills the connections immediately.

However, being able to do so doesn't remediate my concern that websites should disconnect ports (or at least put them in the time_wait state) immediately when I leave that same website.

more options

Well in negotiation there is a timeout that is set by the browser and by server if they do not hear from the other. That should resonate with the amount of time it takes for the connection to go away.

more options

I haven't studied the source code but I notice in about:config that some keep-alive parameters mention an idle time of 600 seconds, which is quite a long time. Presumably some or all of those connections would get closed sooner in favor of a new request, but perhaps only on an as needed basis and not based on closing a tab or leaving a page.

You can view those preferences using:

(1) In a new tab, type or paste about:config in the address bar and press Enter/Return. Click the button promising to be careful.

(2) In the search box above the list, type or paste alive and pause while the list is filtered

more options

jcher2000, those settings are definitely worth looking into. I've also been told that in Windows (I use XP SP3) there might be a registry setting which might be responsible.

Thanks very much for replying!