|
-
Apr 21st, 2000, 04:08 AM
#1
Thread Starter
Fanatic Member
Is there an api function to make a winsock control sleep for a certain amount of time without using a timer?
In my program i have a winsock with an index to be able to load a couple of them at a time, and if a connection is detected lets say on winsock(5) then the winsock will send over the data it is sappose to and sleep for a couple seconds.
Can anybody help me in making the winsock fall asleep with API or some other control?? Anything but a timer!
-
Apr 21st, 2000, 05:35 PM
#2
Lively Member
-
Apr 22nd, 2000, 12:47 PM
#3
Thread Starter
Fanatic Member
Timers are to hard to control, for me anyway aspecially if i have winsock(0-100) loaded, id have to make (0-100) timers for every winsock, and that would just take up to much resources, and slow things down and all that ****.
But thanks for the GetTickCount API, im not exactly sure how to use it yet but im sure ill figure out how it works. For now it gives me a value of 931123... i dont know how to read that but whatever, ill figure it out. Thanks for the reply, appriciate it!
ok, so... windows takes 1 minute to search for a file on my PC yet google.com takes 1 second to search the entire internet? 
-
Apr 22nd, 2000, 03:34 PM
#4
Lively Member
Use a combination of Sleep and DoEvents, that will be more fuctional in your situation... see example code below...
Look up 'Sleep' in your API guide and use its declation.
Sleep only requires 1 parameter, that being duraiton in miliseconds.
Sleep 1000
1 second pause via API and system
'Example loop, causes problems with loading stress
'etc.. as you explained in your previous post...
For X = 1 to 100
Load SckSocket(x).UBound +1
SckSocket(x).LocalPort = X
SckSocket(x).Connect HostName(x)
Next X
'More effcient and productive loop
For X = 1 to 100
Load SckSocket(x).UBound +1
SckSocket(x).LocalPort = X
SckSocket(x).Connect HostName(x)
'Cause a pause and let system dump buffers etc...
DoEvents
Sleep 400
DoEvents
Next X
Any problems just reply to this post.
Regards,
 Paul Rivoli 
---------------------
[email protected]
http://members.dingoblue.net.au/~privoli
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|