Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Finding pcs on a wireless network

Status
Not open for further replies.

fidhle

Programmer
May 2, 2001
9
0
0
US
We are networking a Clipper 5.2 application for use on a wireless network. At startup, we search for any other pcs on the network to determine which one is or will be the server. To do this, we are building a search path like this for each possible pc that could be on the network:

IF FILE( \\PCName\FolderName\file.txt )

Depending on the site, there will be anywhere from three to twenty possible pc names. For the largest site, this can take up to two minutes or so before the search finishes and the program continues. Because the users always have to be able to operate off a network, this check has to run every time the program starts. We are hoping to make this seamless to the user so they don't have to change the setup every time the program starts.

Is there a faster way to survey the possible connections? Can we ping the pcs from Clipper? Does anyone know how to detect the presence of a wireless card from Clipper?

Thanks for any help you can offer.

Fidhl
 
Can you ping? Yes, run it in a batch file when you start your app:

Ping 192.168.0.1 -n 1 > ping.txt //creates a new file
Ping 192.168.0.2 -n 1 >> ping.txt //appends to file
Ping 192.168.0.3 -n 1 >> ping.txt

The -n 1 pings once, you can also set a timeout with -w. You can then inspect the file in Clipper.

I doubt that detecting the wireless card is either possible or really necessary. It's the network connection that you need.

It sounds like you need a static server PC of some sort. That way other PC's can log into a control file and you can then detect their presence.

Ian Boys
DTE Systems Ltd
 
Thank you for your quick responses. Since we have assigned static ip addresses for all of the notebooks, I tried the Ping suggestion which did work (used it both within the code with the Run command and with a batch file). However, it did not work any faster.

I'll tell you what we ended up using. Antonio Vila-cha from Portugal responded on another site with a completely different approach. He suggested using the NET VIEW command which returns a list of all pcs on the network. By redirecting the output, we get a text file which can then be examined. The beauty of this is that we only have to search pcs known to be on the network instead of all of the possible ones. It's really fast since our mobile sites will never have more than two or three notebooks in use at one time!


RUN VIEW NET > list.txt

cVar := MEMOREAD(list.txt)
for f := 1 to MLCOUNT(cVar)
cLine := MEMOLINE(cVar, ,f)
if "\\" $ cLine
AADD(aMach, SUBSTR( cLine,3, AT( " ", cLine)) )
endif
next

Of course, you have to be able to bypass your own pc. At this point, we just have to examine the ones found to determine if any are already set up by the program as servers. If none are found, the pc running the program becomes the server.

The simplest solution is sometimes the hardest one to see. Thanks again.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top