Wrox Programmer Forums
| Search | Today's Posts | Mark Forums Read
Intro Programming What is a loop? Which language is best for beginners? What is "object oreinted?" All those types of questions and more are welcome here.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Intro Programming section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
  #1 (permalink)  
Old January 18th, 2006, 11:18 AM
Registered User
 
Join Date: Jan 2006
Location: Indianapolis, IN, USA.
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default Ping another computer

Can anyone tell me how to ping another computer, or if possible, how to tell the ip's they are connected to with pinging. I saw a similar question posted, but there were no replies or it was too old to show replies. Any help would be greatly appreciated. :)

Reply With Quote
  #2 (permalink)  
Old January 23rd, 2006, 12:49 PM
Friend of Wrox
Points: 1,515, Level: 15
Points: 1,515, Level: 15 Points: 1,515, Level: 15 Points: 1,515, Level: 15
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Dec 2003
Location: Oxford, , United Kingdom.
Posts: 488
Thanks: 0
Thanked 3 Times in 3 Posts
Default

> Can anyone tell me how to ping another computer

1. On windows 95/98: go start | run and type command
   On Windows 200/xp: go start | run and type cmd
   On unix/linux get a command prompt or xterm up
2. Type ping <IP_ADDRESS>, replacing <IP_ADDRESS> with the IP of the computer you want to ping. Or ping <DOMAIN_NAME> . On unix/linux systems, use ctrl-c to stop the pinging.

> or if possible, how to tell the ip's they are connected to with pinging.
You'd probably use netstat for this:

On windows:
C:\Documents and Settings\Administrator.CHARLIE.000>netstat -p tcp -an

Active Connections

  Proto Local Address Foreign Address State
  TCP 0.0.0.0:135 0.0.0.0:0 LISTENING
  TCP 0.0.0.0:445 0.0.0.0:0 LISTENING
  TCP 0.0.0.0:1025 0.0.0.0:0 LISTENING
  TCP 0.0.0.0:1028 0.0.0.0:0 LISTENING
  TCP 0.0.0.0:1035 0.0.0.0:0 LISTENING
  TCP 0.0.0.0:1042 0.0.0.0:0 LISTENING
  TCP 0.0.0.0:1048 0.0.0.0:0 LISTENING
  TCP 127.0.0.1:1047 0.0.0.0:0 LISTENING
  TCP 127.0.0.1:1047 127.0.0.1:1048 ESTABLISHED
  TCP 127.0.0.1:1048 127.0.0.1:1047 ESTABLISHED
  TCP 192.168.129.1:139 0.0.0.0:0 LISTENING
  TCP 192.168.254.7:139 0.0.0.0:0 LISTENING
  TCP 192.168.254.7:1027 0.0.0.0:0 LISTENING
  TCP 192.168.254.7:1027 192.168.254.202:139 ESTABLISHED
  TCP 192.168.254.7:1028 192.168.254.203:445 ESTABLISHED
  TCP 192.168.254.7:1031 0.0.0.0:0 LISTENING
  TCP 192.168.254.7:1031 192.168.254.203:139 ESTABLISHED
  TCP 192.168.254.7:1042 192.168.254.202:22 ESTABLISHED
  TCP 192.168.254.7:1838 0.0.0.0:0 LISTENING
  TCP 192.168.254.7:1838 192.168.254.202:139 ESTABLISHED
  TCP 192.168.254.7:2092 0.0.0.0:0 LISTENING
  TCP 192.168.254.7:2092 192.168.254.14:139 ESTABLISHED

on unix/linux:
 netstat -tpan
(Not all processes could be identified, non-owned process info
 will not be shown, you would have to be root to see it all.)
Active Internet connections (servers and established)
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
tcp 0 0 0.0.0.0:993 0.0.0.0:* LISTEN -
tcp 0 0 127.0.0.1:10024 0.0.0.0:* LISTEN -
tcp 0 0 127.0.0.1:10025 0.0.0.0:* LISTEN -
tcp 0 0 0.0.0.0:139 0.0.0.0:* LISTEN -
tcp 0 0 0.0.0.0:143 0.0.0.0:* LISTEN -
tcp 0 0 0.0.0.0:2000 0.0.0.0:* LISTEN -
tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN -
tcp 0 0 0.0.0.0:25 0.0.0.0:* LISTEN -
tcp 0 0 192.168.254.202:143 192.168.254.9:1215 ESTABLISHED -
tcp 0 0 192.168.254.202:139 192.168.254.30:1135 ESTABLISHED -
tcp 0 0 192.168.254.202:143 192.168.254.120:2249 TIME_WAIT -
tcp 0 0 192.168.254.202:139 192.168.254.48:1027 ESTABLISHED -
tcp 0 0 192.168.254.202:143 192.168.254.120:2251 TIME_WAIT -
tcp 0 0 192.168.254.202:139 192.168.254.120:2058 ESTABLISHED -
tcp 0 0 192.168.254.202:139 192.168.254.22:1060 ESTABLISHED -
tcp 0 0 192.168.254.202:139 192.168.254.4:1718 ESTABLISHED -
tcp 0 0 192.168.254.202:143 192.168.254.120:2250 TIME_WAIT -
tcp 0 0 192.168.254.202:139 192.168.254.101:1816 ESTABLISHED -
-----8<-----

HTH
Charlie

--
Don't Stand on your head - you'll get footprints in your hair
                                           http://charlieharvey.org.uk
                                              http://charlieharvey.com
Reply With Quote
  #3 (permalink)  
Old January 23rd, 2006, 01:31 PM
Registered User
 
Join Date: Jan 2006
Location: Indianapolis, IN, USA.
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thank you so much for the help! I am a little confused about the following section

or if possible, how to tell the ip's they are connected to with pinging.
> You'd probably use netstat for this: > > On windows: > C:\Documents and Settings\Administrator.CHARLIE.000>netstat -p tcp -an

I am not sure how to enter the last line there. I am not extremely skilled on the computer so I am sorry if this is an idiotic question. Thank you so much for any help.

Reply With Quote


Similar Threads
Thread Thread Starter Forum Replies Last Post
ping in c++ assareh C++ Programming 10 August 5th, 2009 10:15 AM
Ping another computer Phreaky .NET Web Services 0 January 18th, 2006 11:08 AM
please help ping from client browser nlicata Javascript 1 June 10th, 2004 12:23 PM
Ping in VC++6 Charley Visual C++ 0 May 13th, 2004 09:28 AM
Ping another computer nvillare .NET Web Services 0 November 30th, 2003 04:05 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.