Poll: Is it any good?
You do not have permission to vote in this poll.
Yeah
62.50%
15 62.50%
No
8.33%
2 8.33%
A little
29.17%
7 29.17%
Total 24 vote(s) 100%
* You voted for this item. [Show Results]

Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Socket for Movement - Completed
#36
Actually, it is a bit more complicated than that. Although VB6 applications are single-threaded, this does not mean VB6 applications use one thread. A send operation is like a file write - you only need to know that it will be written, not that it is written. I am not saying this is how it is done - I am not sure exactly - but it would not be surprising if a Winsock send is completed upon not the data being sent but the data being written to the socket output buffer. In fact, it is likely this is the case, or close to it, since the socket will queue packets if Nagling is enabled without blocking the process until they are sent. The socket wont be able to be written to directly after you finish your last write, it still may have extra processing to do on the packet which could increase the block time on the next send if it is still in this "finalizing" state.

So using multiple sockets, you can basically get a very cheap, very poor usage of the system thread pool to output very minimal work to foreign threads. Though, theres probably next to no benefit of doing this when it can be all thrown into the same control since it just gives the OS the more work in the end unless the sockets are bound to different addresses or using different protocols.
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)