presence of a computer on a LAN
Me and my neighbour have a LAN and I made a program in Delphi 2
which we use to send simple messages to eachother.
It works similar to mail-slots - it stores messages like files in a shared
folder.
But there's more to it. If it cannot access my neighbour's computer,
which is of course not on all the time, it stores the message on the local
disk,
and when my neighbour boots up, his program checks my disk if there had
been any
messages left for him.
It all works fine, the only problem is that whenever the program checks for
the
presence of the other computer (by doing an "if DirectoryExists"), it takes
it
quite a lot of time (several seconds) and during that time the program
seems to
use "the whole CPU", according to System Monitor.
But Nothing like that happens to another program (I think it's called
WinChat or
WinTalk), which uses mail-slots. That program, though, as well as all the
other
stuff available for that purpose, is not nearly as handy as the program I
made,
which is why I made it in the first place.
So what I want to know is how to check if the other computer is present on
the
network, some other way than checking for existence of a shared folder.
The one who answers my question will be rewarded by getting this wonderful
program :-)
Jaka