Create a program that will scan all open ports (from 1 to 1024) of a computer (localhost
Question:
Create a program that will scan all open ports (from 1 to 1024) of a computer (localhost or any computer within a network). *Make the first line in your main method with the statement: String host= "localhost"; So that if I want to have another host to check then I simply need to edit the value of the variable with the desired host and run your program.
Sample output 1: (for host variable assigned with "localhost") localhost: 135 is open localhost: 445 is open Sample output 2: (for host variable assigned with "www.slu.edu.ph") www.slu.edu.ph:80 is open www.slu.edu.ph:443 is open www.slu.edu.ph:554 is open
Problem 2:
Rewrite your program in problem 1 such that each check to a port on the specified host will be performed by a runnable or callable object. Note that you are to maintain the first line in your main method with the statement: String host="localhost"; Note: Name the class for the runnable/callable object as PortChecker
Java An Introduction To Problem Solving And Programming
ISBN: 9780134462035
8th Edition
Authors: Walter Savitch