This content has been marked as final. Show 6 replies
Since you are using the Windows ping command, you are limited to its options, namely....
Do you know of a way to ping a port without the windows command?
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
See the attached.
With that script can you define what output is shows on the page based on response time?
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.