-
After a long discussion with Microsoft Tech Support, they finally agreed with me that Winsock has a bug in it. The bug will be fixed in SP3. What happens is when you send data to an array of Winsocks (Let's say two) through a loop, it will miss the first and hit the second one unless you put so uneccessary time in between each loop.
The second issue was about changing Local Port after the array was created but before the connection was accepted. They say that this is not possible, which brings me to question why they insert a local port change in the example provided by MSDN Library. I can almost swear that I did this with VB5 and it worked, but the only true way for me to find out is to rebuild my machine so that there are no VB6 or W98 files on it. If you have 95 and VB5,
could you try this code for me. Open two instances of VB5 - 1 for Client and 1 for Server.
'Server Code ************
'Add a Winsock named sckServer, change the Index to 0
Private intMax As Long
Private Sub Form_Load()
intMax = 0
sckServer(0).LocalPort = 1001
sckServer(0).Listen
End Sub
Private Sub sckServer_ConnectionRequest(Index As Integer, ByVal requestID As Long)
If Index = 0 Then
intMax = intMax + 1
Load sckServer(intMax)
sckServer(intMax).LocalPort = 0
sckServer(intMax).Accept requestID
Load txtData(intMax)
End If
End Sub
Private Sub sckServer_DataArrival(Index As Integer, ByVal bytesTotal As Long)
Msgbox sckServer(Index).LocalPort
End Sub
'Client Code **************
'Add a Winsock named sckClient - don't change anything else
Private Sub Form_Load()
sckClient.RemoteHost = "127.0.0.1"
sckClient.RemotePort = 1110
sckClient.Connect
End Sub
The messge box should say 0, if it says 1001, then I guess I was wrong. Thanks for any help that you can provide.
Sean Thompson
Advance Auto Store's Inc.
Network Technician
-
hye,
I've tried to put a delay between each loop,
it didn't work.
can you be more specific about fixing the bug as it is and about SP3?
Thank you,
Amir Perez([email protected])
-
The temp fix is not good. The delay has to be a long delay... for instance, putting a message box after the send data will solve it, but you have to click ok to continue. The next method was to use a Do While and make the delay a few seconds after each transfer.
If you want information on SP3, I can't help you but to say it works. I received the winsock of SP3 and it went from 100kb to 800kb. Fill out a service request from Microsoft and they will mail it to you and any information that you need. The service request is free and should only take a couple of days.
http://www.microsoft.com/support/supportnet/overview/overview.asp
Choose your version of VB and click go. On the next window, click on Web Response Tool. That should help you.
Sean Thompson
Network Technician
-
I have VB6 with SP3, and my winsock control is still only 100k. Could anybody send me their winsock control?
Sean mentioned that his winsock was 800k. My email address is [email protected], if anyone could send me theirs.
Thanks.
Jake
-
I retract my last post. We got some of the events working correctly with the DoEvents call. Do not need anybody's Winsock control.
Thanks to all who have helped.
Jake