|
-
Sep 11th, 2000, 01:18 PM
#1
Thread Starter
Member
I am using multiple winsocks in my app.
All is good until I unload my winsocks like this:
for i = 1 to 50
unload winsock(i)
next i
while it is unloading, I frequently get an error like:
Memory xxxxxx referenced memory at xxxxxxx. Memory cannot be "Read".
I found out that SP4 for Visual Studio should fix this problem. I installed the Service Pack and this problem is still popping up. Can anyone help me get rid of this stupid error!
-
Sep 11th, 2000, 04:07 PM
#2
Fanatic Member
Could it be that you are trying to "unload" then too fast. Try using DoEvents some place in the uploading statement to slow it down.
Gl,
D!m
-
Sep 12th, 2000, 11:36 AM
#3
Thread Starter
Member
Sorry, i was just using that code as an example
The exact code is:
Code:
For i = 1 To 500
Unload Winsock1(i)
DoEvents
Next i
Anyone know why i am still getting that wierd error?
-
Sep 14th, 2000, 06:42 AM
#4
i think,that you can max open 49 sockets with the winsock ocx. dont ask me why .....
-
Sep 14th, 2000, 08:11 PM
#5
Addicted Member
no you can open hundreds or even thousands of sockets with the winsock control just to test this to make sure I wasnt lieing with out it heh I just made a loop to open 37000 sockets, I will probably run out of memory or something before its finished but it is up to 5000 winsock sockets opened now and is running fine.
but I just also loaded 500 winsocks and then unloaded them again (same method as you) and I didn't get the memory error, I have sp4 installed but my winsock control is the old version than orignally came with vb6 as some program I installed saved the old winsock control over the new one.
maybe its just your computer? or have you tried it on other people and it has performed an error?
but one thing that might be making this is you haven't closed the winsock control before you try to unload them try this:
Code:
For i = 1 To 500
Winsock1(i).Close
Unload Winsock1(i)
DoEvents
Next i
thats the only thing I can think of that might be causing this problem.
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
|