LinuxAnswers - the LQ Linux tutorial section.
Go Back > Forums > Linux Forums > Linux - Networking
User Name
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.


  Search this Thread
Old 08-10-2005, 10:41 PM   #1
LQ Newbie
Registered: Feb 2003
Posts: 22

Rep: Reputation: 15
how to find out if the computer is on the network

I am developing a program in C/C++. I need to know if the current machine running the program is on the network. How can I use the program to find it out?
I had thought of using "ping certain_ip", but it means that ip must always be available. What is the reliable solution? Thank you for your help.

Old 08-10-2005, 10:55 PM   #2
Registered: Apr 2005
Location: NYC
Distribution: Debian, RHEL
Posts: 268

Rep: Reputation: 42
ping is a very low level way to test connectivity between two hosts. Unless there is a dial connection somewhere between the two hosts I don't really see any situation where ping wouldn't work between them.

What exactly do you mean by ip must always be available in order for ping to work? In order for the two devices to be networked some type of protocol must be in use for connectivity to exist. Basically as long as the IP address of the device you want to test for connectivity with, and that will remain static (or at least your program will be able to keep up with any changes) ping should work well.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
how can i find out which filesystem a computer uses? kpachopoulos Linux - Newbie 2 11-12-2005 05:40 AM
how to find my computer address? mfrangos79 Linux - Newbie 9 11-09-2005 06:20 PM
One computer on a three computer network having problems knightofdogbert General 2 10-20-2003 01:56 PM
Nobody else can find my computer aaron_mj Linux - Networking 1 10-27-2002 08:14 AM
What's in my computer/Utility to find out geraldgu Linux - Software 2 12-14-2001 01:04 PM

All times are GMT -5. The time now is 06:57 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration