Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

AppGameKit Classic Chat / CreateHTTPConnection increasing ID bug

Author
Message
janbo
16
Years of Service
User Offline
Joined: 10th Nov 2008
Location: Germany
Posted: 5th Feb 2015 13:10 Edited at: 5th Feb 2015 15:12
I found that ID=CreateHTTPConnection() increases the ConnectionID like all other creating functions do.
BUT DeleteHTTPConnection(ID) does not free the ID like the other functions, the ID will increase whatever I do.

It could run out of the integer range if you make HTTPConnections frequently
think of dedicated game servers, wich register the ip on a master server via http<-im working on that


Example of the problem:



Using AppGameKit V2 Tier1
BatVink
Moderator
21
Years of Service
User Offline
Joined: 4th Apr 2003
Location: Gods own County, UK
Posted: 5th Feb 2015 14:30 Edited at: 5th Feb 2015 14:36
I think the ID is being put to the bottom of the stack of available IDs. It will use it again when it runs out.

It's the same with all IDs, such as sprites:




[EDIT] It would take 136 years to run out of IDs and loop back to the beginning at the rate of 1 connection per second.

Quidquid latine dictum sit, altum sonatur
janbo
16
Years of Service
User Offline
Joined: 10th Nov 2008
Location: Germany
Posted: 5th Feb 2015 15:10
I tested it with sprites now, and you are right it's the same
Somehow, I was sure it would return at 1001 after deleting it.
(maybe it was the FindFreeSprite() Funtion from the DBpro days)

I screwed it up then...

thanks


Using AppGameKit V2 Tier1
Paul Johnston
TGC Developer
22
Years of Service
User Offline
Joined: 16th Nov 2002
Location: United Kingdom
Posted: 5th Feb 2015 17:12
If it does somehow manage to get to the end of the integer range it will loop back round to ID 1. It always looks for a free ID so if you haven't deleted some it will skip over IDs that are in use.

Login to post a reply

Server time is: 2024-11-25 16:29:00
Your offset time is: 2024-11-25 16:29:00