• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 996
  • Last Modified:

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
0
alspivey
Asked:
alspivey
  • 3
  • 2
1 Solution
 
robert_marquardtCommented:
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.
0
 
Wax0rCommented:
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
0
 
alspiveyAuthor Commented:
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.
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
alspiveyAuthor Commented:
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.  
0
 
Wax0rCommented:
It would work just fine - just do the pings anyways in the first place and then just ramp out a load of threads and net send everything simulataneously..

(Mind you - I tested 254 threads and my cpu usage cranked up to 80% for a few secs (while  creating/executing the threads) so you might wanna do it in steps rather than everything at once..) (cpu=2.4ghz)
0
 
alspiveyAuthor Commented:
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

0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now