Avatar of Christopher Schene
Christopher Schene
Flag for United States of America asked on

Need to create a program to test for open TCP ports

I have a need for a port testing tool that I can program to to read and send from one node to another in a network. I know there may be tools that could do this for me, but I want flexibility of changing the functionality as the need arises. My preferred language is Java because I would like to run on both windows and Linux.

Here is what I would like the tool to do:

listen on a specified range of ports for a known message and when we receive that message, close that port.

Similarly, I want the program to write a message to a specified set of ports.

After all ports are verified or after a specified timeout, the program should spit out a report (I can handle this part).

As a follow up question once I have the program working, I want to set it up to use secure protocol as an option.
TCP/IPJava

Avatar of undefined
Last Comment
CEHJ

8/22/2022 - Mon
ASKER CERTIFIED SOLUTION
CEHJ

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
Christopher Schene

ASKER
Looks pretty good I'll try this. I'll ask for the http version in a separate question so you get another 500 points
CEHJ

No - don't worry about the points thanks
Christopher Schene

ASKER
What is the purpose of these lines in the example code?  I have taken a java class, but most of my programming is in C, C#, Vb.net---I am not familiar with the Hash templates

threadGroup = new ThreadGroup(Server.class.getName());
      this.maxConnections = maxConnections;
      services = new HashMap<Integer, Listener>();
      connections = new HashSet<Connection>(maxConnections);

It looks like a good book...I think I'll buy it.
Experts Exchange has (a) saved my job multiple times, (b) saved me hours, days, and even weeks of work, and often (c) makes me look like a superhero! This place is MAGIC!
Walt Forbes
Christopher Schene

ASKER
I purchased the book as well. Thanks!
CEHJ

What is the purpose of these lines in the example code?

There's quite a bit there - which part of that do you mean?

I purchased the book as well. Thanks!

That's a good investment!