• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

pinging port

New Here ,
Oct 20, 2006 Oct 20, 2006

Copy link to clipboard

Copied

I would like to ping a certain port on a server that we have with coldfusion. I can ping the server but I cannot define the port. I am currently using the attached code. Is there any way to modify that to only ping a defined port?
TOPICS
Advanced techniques

Views

423

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Mentor ,
Oct 20, 2006 Oct 20, 2006

Copy link to clipboard

Copied

Since you are using the Windows ping command, you are limited to its options, namely....

Phil

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Oct 20, 2006 Oct 20, 2006

Copy link to clipboard

Copied

Do you know of a way to ping a port without the windows command?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Mentor ,
Oct 20, 2006 Oct 20, 2006

Copy link to clipboard

Copied

I googled ping port and got lots of hits, including this one.

I am just wondering if there is any way that I can code to ping a destination if it is alive or not. However, the server is known to be behind a firewall, and only one port is open to public. So, is there anyone know how to code a "ping" program that could ping on a certain port? I will greatly appreciate for any ideas.

The 'ping' command generates an ICMP echo request packet. ICMP is a protocol over IP that implements "control messages" (flow control, routing, etc.). At level the very concept of TCP/UDP ports is completely irrelevant. (TCP and UDP are other protocols that ride over IP, they are orthogonal to ICMP).
There are a number of programs that you can use for port scanning (and your application seems to call for testing a single port on a single host --- which is a very short list ports to scan). I'd recommend that you look at netcat (sometimes installed as 'nc' on some Linux systems) and nmap.
A quick place to find these and many other interesting tools would be the Trinux web site:
http://www.trinux.org

Phil

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Advisor ,
Oct 20, 2006 Oct 20, 2006

Copy link to clipboard

Copied

See the attached.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Oct 24, 2006 Oct 24, 2006

Copy link to clipboard

Copied

With that script can you define what output is shows on the page based on response time?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Advisor ,
Oct 24, 2006 Oct 24, 2006

Copy link to clipboard

Copied

LATEST
You have much more work to do if you want "response time" of a port.
That concept does not really apply.

A regular "ping" always uses the echo port, port 7. Use the DOS/Linux/OS ping command for this.

If you want "response time" on some other port, then you must write and run an echo program on each TARGET server.

Then you can add to my code to send a small packet and measure the echo time. You will need mad java skilz to do so.

But, since you will have to write the target echo routine (unless you are hacking), you can probably use cfhttp to do the timed data swap -- which would be a lot easier.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources
Documentation