Link to home
Start Free TrialLog in
Avatar of alspivey
alspivey

asked on

NETAPI32.DLL

I'm using NETAPI32.DLL in Delphi 6 to send messages to a group of computers over the internet. Does anyone know how, and if it is possible to make the timeout shorter in NETAPI32.DLL.

Thanks
Avatar of robert_marquardt
robert_marquardt

I would guess that this is a global network timeout and the value is buried somewhere in the registry. Try searching for "network" and "timeout" in the registry.
From what I know it's not possible to change the time-out for the messages themselves, what you can do (and which was also my solution when working with the messenger service) is the following:
- define the addresses your going to netsend
- ping them
- store the addresses that replied
- netsend them

this will allow you to net send a whole netblock in under 5 seconds (including ping, if you multithread it).

another possible advantage of that is:
- filters out people with firewalls (you wouldn't reach them anyways)


A possible solution might be to look in the registry, pherhaps the messenger service has it's own specific settings.

Good luck
Avatar of alspivey

ASKER

I am pinging them but if the message service is off I still get a ping back and it takes about 10 seconds for NETAPI32.DLL to timeout and return the error.  I have seen other programs doing the same thing without this delay.  Is there any other way to do the net send without useing NETAPI32.DLL.
How well would a thread work with NETAPI32.DLL. Would that be an option that would allow multiple NET SENDS so the long timeout would not be so noticed.  
ASKER CERTIFIED SOLUTION
Avatar of Wax0r
Wax0r

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Hi Wax0r,

Could you post an example of multi-threading the NETAPI32 calls?  I must admit threadind is not one of my stronger attributes.

Thnaks