Hello people,
I have not posted here in over a year.
I used to be the lead programmer for a period of time for the Drasil project, (though I think many may have claimed that title over the years).
Anyways, I have recently dug up the old vgGore codebase because of one part of it, and one part only... The GORESocket controls.. which are truly a gem for anyone looking to do any sort of multi-client server in VB6...
So, basically since I already felt very comfortable with the codebase surrounding GOREsockets I decided to throw together a sort of demo project/platform to build off of in the future, by mostly copy-pasting, some parts re-writing, a simple chatroom server that can accept multiple connections and relay packets using the fantastic binary packets system included in vbGore..
I started noticing from debugging though that the GoreSOCKETS control is either not cleaning its array properly or I've missed something.
Please see the below screenshot:
Click to EnlargeI've set up (very cheaply, using a timer, yuck..) a label that basically spits out the state of the server's sockets and some data from the userlist that is used to keep the sockets cleaned and such.. (seen in screenshot).
As you can see above.. even though the '
User_CleanArray' and '
Server_CloseSocket are being called when needed, and although the sockets' states are being converted back to 0 (disconnected), the returned 'inSox' parameter upon connection
intermittently seems to increment the 'number of sockets' when not needed.
the confusing part is that this is not always the case, most of the time if you close the client or click the 'disconnect' button everything gets cleaned and the array of sockets gets downsized. It's just if you do it a few times in a row quickly, it eventually starts to build new socket instances onto the array, even though the state of the first sockets in the array DOES get switched to '0' (disconnected) and could be used for a new connection.I've noticed it happens when the client is terminated prematurely (even though proper shutdown code has been added, aswell as time-out checkers...
Spodi, or anyone else, I was planning on using the sockets platform for a project I wanted to throw together, I'd be willing to pay like $20 for you to take a moment to look over the code and fix this issue, or fix the ocx control if that is where the problem lies.
Here is a link to my code for this 'shell client-server platform' I've been scraping together from vbGore code...
http://www.sakurabranch.com/gore/Code.7z