You can use ping to test whether you can connect to a remote host:
ping baidu.com ping 125.6.45.88
(Actually it tests on what port number??)
When you want to ping with the specified port number, please use:
telnet 123.45.6.78 8080
If CMD shows you refuse message, then the port number is not open. If it shows you nothing but a black screen, the port is good.
(Remember to enable telnet service on winXP/7 , as it's not safe not encrypted communication protocol, microsoft defaultly disable such component...)