[Twisted-Python] custom FTP server is blocking

Adi Roiban adi at roiban.ro
Fri Mar 20 06:19:10 MDT 2015


On 20 March 2015 at 11:16, Paul Wiseman <poalman at gmail.com> wrote:
> On 19 March 2015 at 20:38, Louis D. Burr <ldanielburr at me.com> wrote:
>> Hi Paul,
>>
>>> On Mar 19, 2015, at 1:18 PM, Paul Wiseman <poalman at gmail.com> wrote:
>>>
> I want to stream the http request back to the client connected over
> FTP. I guess I could do that with io.BytesIO right? I can't figure out
> how to wire it up though. I've added agent.request which is firing
> back a twisted.web.client.Response but I'm not sure how to stream the
> data from that into the BytesIO object so that _FileReader has a file
> like interface to read from.

Without an example code use on your side I find it hard to help here.
Do you have an http://sscce.org/ for your problem?

Most probably you will need to implemented your own FileReader which
will hook into the response.deliverBody with a protocol which will
forward the data from dataReceived to your FTP data connection...all
this using a consumer/producer API.

Cheers
-- 
Adi Roiban




More information about the Twisted-Python mailing list