Re: Realtime streams and FTP server

Giganews Newsgroups
Subject: Re: Realtime streams and FTP server
Posted by:  Khash Sajadi (kha…@btinternet.com)
Date: Wed, 20 Jul 2005

As a temporary fix here what I did (it might be useful to others)

I set the size proior to the start of the transfer to the maximum number of
bytes possible and move the position as I go on. Then when there is not more
data to serve, I replaced the line in IOHandler that throws the "No data to
read" exception to set the ASize variable to LBufSize so the "while" loop is
finished. It's been working fine with no complains since.

"Khash Sajadi" <kha…@btinternet.com> wrote in message
news:9DB2AD2908D3E240kha…@btinternet.com...
>I have a problem with Indy FTP Server.
>
> I have to use a real time stream as the TStream object used by the server
> to retrieve the data for the data channel.
>
> The problem is WriteToStream method of TIdFTPServer.DoDataChannelOperation
> calls the .Size of the stream to pass to
> AContext.FDataChannel.FDataChannel.IOHandler.Write as a parameter.
>
> In IOHandler it is also mentioned (as a comment in TIdIOHandler.Write)
> that we use .Size and it should return a value although it might be a real
> time stream. I asked this question before on this newsgroup and Remy
> Lebeau suggested that I set the size to the maximum possible value and the
> upon the end of the stream set to position equal to the size.
>
> The problem is it seems the  "while ASize > 0 do begin" line in
> TIdIOHandler.Write expects to have ASize number of bytes and keeps calling
> AStream.ReadBytes. And in the case of AStream.ReadBytes returning 0 number
> of bytes an EIdNoDataToRead is thrown.
>
> What I need to know now is, is there a way of using real time streams in
> FTP server or somehow telling the server to stop asking for more data from
> the stream without breaking anything in the server?
>
> Thank you,
>
> Khash

Replies

None

In response to

Realtime streams and FTP server posted by Khash Sajadi on Tue, 19 Jul 2005