简体   繁体   English

如何关闭Windows 7中打开的端口?

[英]How do i close an opened port in Windows 7?

当我尝试启动我的基于java的服务器时,有一条消息说该端口已经在使用......并且我的所有Java Web服务器都已停止...所以,如果有人可以帮助我,我会很感激...

If there is really still a process that has the port open, you can easily check for that (and close the process) via TCPView . 如果确实有一个进程打开了端口,您可以通过TCPView轻松检查(并关闭进程)。 It might be that the port is just lingering (for example due to not being shutdown properly), in which case you'd have to wait for the socket to close and check that the code is clear with regard to that. 可能是端口只是挥之不去(例如由于未正确关闭),在这种情况下,您必须等待套接字关闭并检查代码是否清楚。

I was trying to establish socket communication between PC ( JAVA Server )<--> Android ( Client ) 我试图在PCJAVA Server )之间建立套接字通信< - > Android客户端

on Debugging, popped the problem : Address already in use 在调试时,弹出了问题: Address already in use

instant/feasible resolution i found out was to: 我发现即时/可行的解决方案是:

  • run cmd as adminstrator 管理员身份运行cmd
  • netstat -abn netstat -abn
  • find the process listening to the port of intrest 找到听取intrest端口的进程
  • terminate the process from task manager 任务管理器终止进程

PS : Unlike from an external application mentioned in previous answers, steps in this answer allows you to find out the used ports with the resources already present. PS:与之前答案中提到的外部应用程序不同,此答案中的步骤允许您查找已使用资源的已使用端口。

A few options... us TCPView to find the program that has the port open and kill it... reboot... just reset the network connection. 一些选项......我们使用TCPView查找端口打开并杀死它的程序...重启...只需重置网络连接。 Try those. 试试那些。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何关闭以前打开的布局? - How do I close a previously opened layout? 如何关闭由 Selenium 打开的所有 Chrome windows - How to close all Chrome windows opened by Selenium 在程序终止的情况下如何关闭端口? - How do I close a port in a case of program termination? 在 Eclipse 中调试 java 应用程序时,如何将其配置为不关闭调试器打开的文件? - When debugging java application in Eclipse, how do I configure it to not close the files the debugger opened? grails应用程序中的“打开文件太多” - 如何正确关闭打开的文件和流? - “Too many open files” in a grails application - how do I close opened files and streams correctly? 无法关闭所有打开的Windows - Unable to close all opened Windows 我是否需要在 Java 中手动关闭文件(使用路径打开)? - Do I need to close a file (opened using Paths) manually in Java? I have opened multiple websocket client data stream in jetty java with different api and secret calls, how do i close a particular session? - I have opened multiple websocket client data stream in jetty java with different api and secret calls , how do i close a particular session? 如何以编程方式监视已经打开的串行端口上的活动? - How can I programmatically monitor the activity on an already opened serial port? 如何关闭由Selenium打开的所有空闲Web浏览器? - How can i close all idle web browsers opened by selenium?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM