windows 如何查找哪个应用程序正在占用我的端口?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/6960019/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-09 08:38:38  来源:igfitidea点击:

How do I find which application is using up my port?

windowsportwindows-vistanetstat

提问by Flethuseo

I am unable to start GlassFish, because it keeps showing this error message:

我无法启动 GlassFish,因为它一直显示以下错误消息:

SEVERE: Shutting down v3 due to startup exception : No free port within range: 8080=com.sun.enterprise.v3.services.impl.monitor.MonitorableSelectorHandler@ed7d1

How can I find what applications are using what ports on Windows Vista? I have tried using nmap zenmap using the following target:

如何在 Windows Vista 上找到哪些应用程序正在使用哪些端口?我尝试使用以下目标使用 nmap zenmap:

http://127.0.0.1:8080

http://127.0.0.1:8080

But all I get is this:

但我得到的只是这个:

Starting Nmap 5.51 ( http://nmap.org ) at 2011-08-05 12:05 Central Daylight Time

NSE: Loaded 57 scripts for scanning.

Read data files from: C:\Program Files\Nmap
Nmap done: 0 IP addresses (0 hosts up) scanned in 4.55 seconds
           Raw packets sent: 0 (0B) | Rcvd: 0 (0B)
WARNING: No targets were specified, so 0 hosts scanned.

回答by Peter Kellner

How about netstat?

netstat 呢?

http://support.microsoft.com/kb/907980

http://support.microsoft.com/kb/907980

The command is netstat -anob.

命令是netstat -anob.

(Make sure you run command as admin)

(确保您以管理员身份运行命令)

I get:

我得到:

C:\Windows\system32>netstat -anob

Active Connections

活动连接

     Proto  Local Address          Foreign Address        State           PID
  TCP           0.0.0.0:80                0.0.0.0:0                LISTENING         4
 Can not obtain ownership information

  TCP    0.0.0.0:135            0.0.0.0:0              LISTENING       692
  RpcSs
 [svchost.exe]

  TCP    0.0.0.0:443            0.0.0.0:0              LISTENING       7540
 [Skype.exe]

  TCP    0.0.0.0:445            0.0.0.0:0              LISTENING       4
 Can not obtain ownership information
  TCP    0.0.0.0:623            0.0.0.0:0              LISTENING       564
 [LMS.exe]

  TCP    0.0.0.0:912            0.0.0.0:0              LISTENING       4480
 [vmware-authd.exe]

And If you want to check for the particular port, command to use is: netstat -aon | findstr 8080from the same path

如果你想检查特定的端口,使用的命令是: netstat -aon | findstr 8080来自同一路径

回答by Carlos Quintanilla

To see which ports are available on your machine run:

要查看您的机器上可用的端口,请运行:

C:>  netstat -an |find /i "listening"

回答by ritesh

It may be possible that there is no other application running. It is possible that the socket wasn't cleanly shutdown from a previous session in which case you may have to wait for a while before the TIME_WAIT expires on that socket. Unfortunately, you won't be able to use the port till that socket expires. If you can start your server after waiting for a while (a few minutes) then the problem is not due to some other application running on port 8080.

可能没有其他应用程序在运行。套接字可能没有从前一个会话中完全关闭,在这种情况下,您可能需要等待一段时间才能在该套接字上的 TIME_WAIT 到期。不幸的是,在该套接字到期之前,您将无法使用该端口。如果您在等待一段时间(几分钟)后可以启动服务器,那么问题不是由于在端口 8080 上运行的其他应用程序造成的。

回答by jontsai

On the command prompt, do:

在命令提示符下,执行:

netstat -nb