by Michael Bapst (1 Submission)
Category: Libraries
Compatability: Visual Basic 5.0
Difficulty: Advanced
Date Added: Wed 3rd February 2021
Rating:
(6 Votes)
Simplifies the use of the winsock control in creating a client/server connection of TCP/UDP IP network. The winsock control was extremely clumsy when you need to make multiple connection (EX: server application) you were limited in the number of connection you could have because VB's control array limitation (approx. 32000). When a connection was lost, you needed to sort through the array, remove the 'dead' control and re-index the array. Also there was a bug in the earlier versions of the winsock control where only the last control added to the array could send data. What I have done was created an activeX .dll that you could reference in your project that mimicks the winsock control. Instead of using an array of controls, every connection is added to a collection (collection manipulation is much better and easier than an array). Plus I have added serveral useful server functions, such as .BroadcastAll (send data to all connections), .KillSocketOnClose (removes connections from the collection automatically when the connection is lost), .CreateServer (creates the server with one line of code), ect.
PLEASE NOTE: When compiling this project, make sure that the Winsock control is referenced. This code still uses it for all the dirty work.
Assumes
If the user knows how to use the Winsock control, this is project shouldn't be a problem. When declaring your server object, it should be declared 'WithEvents' (EX: Private WithEvents Server as RokSockets).
Side Effects
None that I have noticed or have reported back to me.