Newsgroups : Borland : borland.public.delphi.internet.winsock : 2006 Apr : Re: TidStreamVCL or TIdStreamVCLWin32???

www.cryer.info
Managed Newsgroup Archive

Re: TidStreamVCL or TIdStreamVCLWin32???

Subject:Re: TidStreamVCL or TIdStreamVCLWin32???
Posted by:"Jacques Noah" (jacques.no..@btinternet.com)
Date:Sat, 8 Apr 2006 14:46:12

Thank you very much, i've now read up about streams and have a better
understanding then before.

Another problem arised when i added a idTCPClient component to my project.
When i try to run it, a error message saying: 'Property ConnectTimeOut does
not exist'. The only component on the form is the idTcpClient and i've not
tried to connect with it at all, so i'm abit confused as to why it is
refering to any kind of connection?? The connecttimeout property is set
to -1 in the object inspector. When i actually try to set the property
programmatically in the OnformCreate event, the property does not exist.
There is a idTcpclient.connect(ATimeout) option, but i'm not sure if it is
the same as the explicitly named property in the object inspector? So the
Connecttimeout property does not exist when i try to set it
programmatically, but exist on the object inspector?

Any suggestions?
Thanks


"Remy Lebeau (TeamB)" <no.spam@no.spam.com> wrote in message
news:4436a951$1@newsgroups.borland.com...
>
> "Jacques Noah" <jacques.noah@btinternet.com> wrote in message
> news:44359b6c$1@newsgroups.borland.com...
>
>> Thank you for your reply, i still do not know what to leave out and
>> what to include when sending and recieving files through streams.
>
> I already told you exactly what to do - get rid of TIdStreamVCL completely
> from your code, and just pass your stream in directly everywhere you were
> previously passing in TIdStreamVCL, ie:
>
>    --- server ---
>
>    var
>        MStream: TMemoryStream;
>    begin
>        MStream := TMemoryStream.Create;
>        try
>            AContext.Connection.IOHandler.ReadStream(MStream);
>            mstream.SaveToFile(filename);
>        finally
>            MStream.Free;
>        end;
>    end;
>
>
>    --- client ---
>
>    var
>        FStream: TFileStream;
>    begin
>        FStream := TFileStream.Create(fn, fmOpenRead or fmShareDenyWrite);
>        try
>            Context.Connection.IOHandler.Write(FStream, 0, True);
>            Context.Connection.IOHandler.WriteLn('done!');
>        finally
>            FStream.Free;
>        end;
>
>
> Now, if you want your code to be portable to other platforms, then use
> Indy's own stream types instead:
>
>    --- server ---
>
>    var
>        MStream: TIdMemoryStream;
>    begin
>        MStream := TIdMemoryStream.Create;
>        try
>            AContext.Connection.IOHandler.ReadStream(MStream);
>            mstream.SaveToFile(filename);
>        finally
>            MStream.Free;
>        end;
>    end;
>
>
>    --- client ---
>
>    var
>        FStream: TIdReadFileExclusiveStream;
>    begin
>        FStream := TIdReadFileExclusiveStream.Create(fn);
>        try
>            Context.Connection.IOHandler.Write(FStream, 0, True);
>            Context.Connection.IOHandler.WriteLn('done!');
>        finally
>            FStream.Free;
>        end;
>
>
> Gambit

Replies:

In response to:

www.cryer.info
Managed Newsgroup Archive