【问题标题】:Can't use port 8080无法使用端口 8080
【发布时间】:2018-01-30 08:41:47
【问题描述】:

当我尝试在端口 8080 上运行服务 (RavenDB) 时,它会停止并且 Windows 日志显示以下错误:

System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.Net.HttpListenerException: Failed to listen on prefix 'http://+:8080/' because it conflicts with an existing registration on the machine.

根据 IIS 和netstat -an | find "8080",该端口当前未使用。

如果我将端口更改为任何其他端口,问题就会消失。

【问题讨论】:

  • 如果你输入telnet localhost 8080,有什么反应吗?
  • 我收到Connecting To localhost...Could not open connection to the host, on port 8080: Connect failed
  • 所以绝对没有什么在听。我想知道 .net 在哪里找到它的“现有注册”

标签: windows-10 port


【解决方案1】:

端口 8080 可能实际上正在使用中。复制another answer

netstat -a 只列出连接的套接字和监听的套接字。

-a 显示所有连接和监听端口。两者都不 在您的套接字上调用了 connect 或 listen,因此它不在 netstat -a 的权限。

但是,从 Windows 10 开始,您可以使用 netstat -q。

-q 显示所有连接、监听端口和绑定

您也可以尝试使用来自SysInternals suite 的tcpview 查看端口。按端口号排序。它还会告诉您使用该端口的进程,然后您可以将其终止。

【讨论】:

  • 端口也不显示在那里。不过,我会看看 SysInternals 套件。谢谢
猜你喜欢
  • 2014-10-07
  • 1970-01-01
  • 1970-01-01
  • 2019-12-23
  • 2014-07-01
  • 2018-04-18
  • 2020-11-27
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多