VBcoders Guest



Don't have an account yet? Register
 


Forgot Password?



Winsock backlogs overcome...

by Bidders (2 Submissions)
Category: Internet/HTML
Compatability: Visual Basic 3.0
Difficulty: Beginner
Date Added: Wed 3rd February 2021
Rating: (7 Votes)

Have you ever written an application that utilises Microsoft's Winsock control? have you ever found that when you tried to send data to a socket, that data becomes compounded with other data sent at a similar time, instead of in a separate transmission? Also applies to those who write multiple connection servers. Read on.

Rate Winsock backlogs overcome...

This may seem really obvious to you, but myself and George, co-authors of Chapp, have both had immense problems with compounded messages, and messages that would seemingly never send. The situation in which this may be of use is where you have a control-array of winsocks acting as distribution channels for some kind of server. say you wanted to distribute a piece of data to each of the socks. looping through the array and sending to each that had a suitable connection state (7) seems the best way. the problem comes when VB sends the first message and queues the rest... but why?! i've been unable to find any documentation related to this on PSC or on MSDN etc... we've spent months trying to overcome it. and we finally have. Slap a DoEvents on the line before your call to the sockets' senddata function. that's it...
for x=0 to 9
DoEvents
Winsock1(x).senddata "bootittyrah"
next x
Without the doevents, the app wouldn't actually send the other bits of data, until the project is paused and resumed... Strange, but true. at least it was for us. Sorry for the long-windedness... we felt it was justified, based on the time we spent figuring this out. oh, and plz, let's not do the dissing thing? :)

Download this snippet    Add to My Saved Code

Winsock backlogs overcome... Comments

No comments have been posted about Winsock backlogs overcome.... Why not be the first to post a comment about Winsock backlogs overcome....

Post your comment

Subject:
Message:
0/1000 characters