Re: [twsocket] Possible CliId duplication

2011-05-25 Thread Maurizio Lotauro
Scrive Arno Garrels arno.garr...@gmx.de: Maurizio Lotauro wrote: Scrive Arno Garrels arno.garr...@gmx.de: [...] Cardinal and Integer should not change since (IIRC) NativeInt and NativeUInt was introduced to handle 32/64 bit cpu. That's correct Integer will remain 32 bit in x64 however

Re: [twsocket] Possible CliId duplication

2011-05-25 Thread Arno Garrels
Maurizio Lotauro wrote: Scrive Arno Garrels arno.garr...@gmx.de: Maurizio Lotauro wrote: Scrive Arno Garrels arno.garr...@gmx.de: [...] Cardinal and Integer should not change since (IIRC) NativeInt and NativeUInt was introduced to handle 32/64 bit cpu. That's correct Integer will

Re: [twsocket] Possible CliId duplication

2011-05-24 Thread Maurizio Lotauro
Scrive Arno Garrels arno.garr...@gmx.de: Francois PIETTE wrote: if FClientNum = $7F then currently it wraps around after 8,388,607 That is probably my bug, missed an F. Should probably be MAXINT to avoid any issue with integer size change. And a cast of FClientNum to an

Re: [twsocket] Possible CliId duplication

2011-05-24 Thread Arno Garrels
Maurizio Lotauro wrote: Scrive Arno Garrels arno.garr...@gmx.de: Francois PIETTE wrote: if FClientNum = $7F then currently it wraps around after 8,388,607 That is probably my bug, missed an F. Should probably be MAXINT to avoid any issue with integer size change. And a cast

[twsocket] Possible CliId duplication

2011-05-13 Thread Anton S.
In OverbyteIcsWSocketS unit, TCustomWSocketServer.TriggerSessionAvailable method, Client.FCliId is determined as incremental counter. But as this counter is resetted after $7F, it is possible that some client IDs are duplicated. Of course it would be a very rare case but it could lead to

Re: [twsocket] Possible CliId duplication

2011-05-13 Thread Arno Garrels
Anton S. wrote: In OverbyteIcsWSocketS unit, TCustomWSocketServer.TriggerSessionAvailable method, Client.FCliId is determined as incremental counter. But as this counter is resetted after $7F, it is possible that some client IDs are duplicated. Of course it would be a very rare case but

Re: [twsocket] Possible CliId duplication

2011-05-13 Thread Anton S.
It is only guaranteed that _connected clients never share the same CliId. I couldn't see _where_ it is guaranteed... It's quite possible to have 1st client with ID 1 connected for a long, long time while others connect and disconnect very frequently (i.e. large proxy and a client downloading

Re: [twsocket] Possible CliId duplication

2011-05-13 Thread Francois PIETTE
It is only guaranteed that _connected clients never share the same CliId. I couldn't see _where_ it is guaranteed... It's quite possible to have 1st client with ID 1 connected for a long, long time while others connect and disconnect very frequently (i.e. large proxy and a client downloading

Re: [twsocket] Possible CliId duplication

2011-05-13 Thread Anton S.
Let's do some computation: the ID wrap around after 2.147.483.647 connections. If you have 100 connections/disconnections per second, then it will take 248 days to wrap around. Well, if FClientNum = $7F then currently it wraps around after 8,388,607 what is very little and might be

Re: [twsocket] Possible CliId duplication

2011-05-13 Thread Angus Robertson - Magenta Systems Ltd
if FClientNum = $7F then currently it wraps around after 8,388,607 That is probably my bug, missed an F. Will be fixed before you manage to reproduce 8 million FTP connections in a single session. Angus -- To unsubscribe or change your settings for TWSocket mailing list please goto

Re: [twsocket] Possible CliId duplication

2011-05-13 Thread Arno Garrels
Angus Robertson - Magenta Systems Ltd wrote: if FClientNum = $7F then @Anton Thanks! currently it wraps around after 8,388,607 That is probably my bug, missed an F. Actually two ;) Anton is realy good in finding such slips. -- Arno Garrels -- To unsubscribe or change your

Re: [twsocket] Possible CliId duplication

2011-05-13 Thread Francois PIETTE
if FClientNum = $7F then currently it wraps around after 8,388,607 That is probably my bug, missed an F. Should probably be MAXINT to avoid any issue with integer size change. -- francois.pie...@overbyte.be The author of the freeware multi-tier middleware MidWare The author of the