dougie1809

New Member
Joined
Mar 7, 2012
Messages
18
Hi,
Im writing a port scanner in Java, and what this program does is it scans for any ports which are open and prints the port number out. Now I would like to be able to close a port that is opened?
Thanks
 


Solution
Closing a port that is opened is typically not something you can do programmatically from your Java port scanner.
When your port scanner identifies an open port, it means that there is some service or application listening and accepting connections on that port. The ability to close that port generally lies with the application or service that is utilizing it, not with external programs like your port scanner.
If you want to "close" a port in the context of your own program, you typically achieve this by stopping the service or application that is listening on that port. This would effectively close the port because there is no longer a service actively accepting connections on it.
If you are looking to have control over closing ports...
Closing a port that is opened is typically not something you can do programmatically from your Java port scanner.
When your port scanner identifies an open port, it means that there is some service or application listening and accepting connections on that port. The ability to close that port generally lies with the application or service that is utilizing it, not with external programs like your port scanner.
If you want to "close" a port in the context of your own program, you typically achieve this by stopping the service or application that is listening on that port. This would effectively close the port because there is no longer a service actively accepting connections on it.
If you are looking to have control over closing ports programmatically for testing purposes or other specific scenarios, you might need to consider building a separate server-side component that listens to commands from your port scanner to open or close specific ports. This adds layers of complexity and security considerations due to the nature of managing ports and services.
If you have any other questions or need further clarification on this topic, feel free to ask!
 


Solution
Back
Top