?
Solved

NETAPI32.DLL

Posted on 2003-02-25
6
Medium Priority
?
984 Views
Last Modified: 2008-02-01
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
Comment
Question by:alspivey
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
6 Comments
 
LVL 11

Expert Comment

by:robert_marquardt
ID: 8023606
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
 
LVL 1

Expert Comment

by:Wax0r
ID: 8024291
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
 

Author Comment

by:alspivey
ID: 8026467
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
Independent Software Vendors: 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!

 

Author Comment

by:alspivey
ID: 8026871
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
 
LVL 1

Accepted Solution

by:
Wax0r earned 600 total points
ID: 8041718
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
 

Author Comment

by:alspivey
ID: 8042374
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

Independent Software Vendors: 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!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

A lot of questions regard threads in Delphi.   One of the more specific questions is how to show progress of the thread.   Updating a progressbar from inside a thread is a mistake. A solution to this would be to send a synchronized message to the…
In this tutorial I will show you how to use the Windows Speech API in Delphi. I will only cover basic functions such as text to speech and controlling the speed of the speech. SAPI Installation First you need to install the SAPI type library, th…
In this brief tutorial Pawel from AdRem Software explains how you can quickly find out which services are running on your network, or what are the IP addresses of servers responsible for each service. Software used is freeware NetCrunch Tools (https…
Sometimes it takes a new vantage point, apart from our everyday security practices, to truly see our Active Directory (AD) vulnerabilities. We get used to implementing the same techniques and checking the same areas for a breach. This pattern can re…
Suggested Courses
Course of the Month12 days, 10 hours left to enroll

777 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question