Board index » delphi » presence of a computer on a LAN

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

 

Re:presence of a computer on a LAN


Quote
Jaka Jaksic wrote in message

<01bd1d56$899e7c60$9c1e0...@jumper.babjavas.si>...
|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.
[snip]

What does this mean : do you actually *use* mailslots or dont't you? I once
wrote something similar *with* mailslots, which did not have this behaviour.
(that is : under NT4, W95 may be a different story)

|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
|
 Yup, this is obviously the network layer that is timing out. May be, just
may be this timeout value can be adjusted somewhere deep down in the
registry...

Regards,
Dirk
_____________________________________________
Office : <dirk.claessens...@belgium.agfa.com>
Home   : <dirk.claess...@village.uunet.be>
_____________________________________________

Re:presence of a computer on a LAN


What protocol are the machines using? If you are using TCP/IP you could
simply "ping"  your neighbors ip address and if no answer in x
milliseconds, store on the local hard drive.
If you are using NetBEUI or ipx, there must be similar functionality to
ping available....

Quote
Jaka Jaksic wrote:
> 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

Other Threads