[Twisted-Python] sending file but LineReceiver doesnt run

Amaury Forgeot d'Arc amauryfa at gmail.com
Tue Nov 25 09:51:27 EST 2008


On Tue, Nov 25, 2008 at 15:17, Jean-Paul Calderone <exarkun at divmod.com> wrote:
> On Tue, 25 Nov 2008 12:41:46 +0200, Aydın ŞEN <adigeaydin at gmail.com> wrote:
>> Hi,
>> I am trying to send file which is in the client's disk, i am using
>> LineReceiver in the server side. I am sending and receiving data like
>> login
>> stuff but when i start to read & send file LineReceiver method doesnt run
>> in
>> the server side. Sending file code part is below, what can be cause of
>> this?

The LineReceiver implements a limit of MAX_LENGTH = 16384 bytes per "line".
When you send 100KB in a row, it calls it lineLengthExceeded() method
and loses its connection...

> File transfers are not best done using a line-oriented protocol.  Have a
> look
> at the "Protocol Design" articles linked from <http://itamarst.org/>.
> Jean-Paul


Amaury Forgeot d'Arc

More information about the Twisted-Python mailing list