 |
BorlandTalk.com Borland discussion newsgroups
|
| View previous topic :: View next topic |
| Author |
Message |
Adrien Reboisson Guest
|
Posted: Wed Nov 24, 2004 8:46 am Post subject: TIdTCPClient / Server - WriteStream question |
|
|
Hi,
I'm using Indy 10 and Delphi 7 to send files over the network. It works fine, but I've question about the maximum stream size which can be send by using WriteStream. Indeed, I noticed that the TIdStreamVCL's size property was coded using an Integer and not an Int64. Why ? Is it deliberate ?
If I want to send a very big file (>5Gb, for instance), should I "cut" manually my file into several parts smaller than 2 Gb ? What is the best way to handle a such case ?
Thank you.
Regards,
A.R.
|
|
| Back to top |
|
 |
Don Siders Guest
|
Posted: Wed Nov 24, 2004 12:42 pm Post subject: Re: TIdTCPClient / Server - WriteStream question |
|
|
| Quote: | I'm using Indy 10 and Delphi 7 to send files over the network.
It works fine, but I've question about the maximum stream size
which can be send by using WriteStream. Indeed, I noticed that
the TIdStreamVCL's size property was coded using an Integer and
not an Int64. Why ? Is it deliberate ?
|
It's a known issue.
In some versions of the VCL, Size and Position in TStream are Integers and not Int64s. Since Indy is supposed to work with all of these VCL versions, the artifact remains in Indy for the moment. There are plans to address it future updates, but I don't know the status of those efforts.
|
|
| Back to top |
|
 |
Remy Lebeau (TeamB) Guest
|
Posted: Wed Nov 24, 2004 7:44 pm Post subject: Re: TIdTCPClient / Server - WriteStream question |
|
|
"Adrien Reboisson" <rabusier___remvthis (AT) _thistoo_free (DOT) fr> wrote
| Quote: | I've question about the maximum stream size which can be send by using
WriteStream. |
The maximum size is the maximum value that fits into an Integer, namely
2147483647, aka approx. 2 GB.
| Quote: | Indeed, I noticed that the TIdStreamVCL's size property
was coded using an Integer and not an Int64. Why ?
|
Because the VCL's TStream.Size property is also an Integer in versions prior
to Delphi/BCB v6.
Besides, even if TIdStreamVCL used an Int64 for its Size, the rest of the
entire Indy library is still Integer-based, and would have to be re-written
everywhere else.
| Quote: | Is it deliberate ?
|
Yes. The issue has already been discussed amongst Indy's developers before,
and the consensus was that Integer was to continue being used for the time
being.
| Quote: | If I want to send a very big file (>5Gb, for instance), should I "cut"
manually my file into several parts smaller than 2 Gb ?
|
Yes. Indy will not handle data > 2Gb at a time.
Gambit
|
|
| Back to top |
|
 |
Remy Lebeau (TeamB) Guest
|
Posted: Wed Nov 24, 2004 7:51 pm Post subject: Re: TIdTCPClient / Server - WriteStream question |
|
|
"Don Siders" <mudshark (AT) rancidbud (DOT) org> wrote
| Quote: | In some versions of the VCL, Size and Position in TStream are
Integers and not Int64s. Since Indy is supposed to work with all
of these VCL versions, the artifact remains in Indy for the moment.
|
With the introduction of TIdStreamVCL, the issue is actually not as bad as
it used to be, I think. All of the versions that Indy targets support the
Int64 data type, so TIdStreamVCL could use Int64 regardless of version, and
the rest of the Indy library simply needs to be updated to use Int64 as well
for progress tracking since all of the values are coming from TIdStreamVCL
now and not TStream directly.
Inside TIdStreamVCL, Integer values can be assigned to Int64 values without
lose of data, so reading the Size and Position and also comparing them
should work fine regardless of version. The only issue would be to make
sure that Int64 values greater than 2GB are not being assigned to TStream's
Size and Position properties in versions prior to Delphi/BCB v6. Since
TIdStreamVCL resides in the "System" folder of Indy's source code hierarchy,
preprocessor macros are allowed in that folder, so TIdStreamVCL can use
IFDEF statements to address that.
Gambit
|
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|