[Twisted-Python] how to design protocol.

Aydın ŞEN adigeaydin at gmail.com
Mon Dec 1 08:19:47 EST 2008

Let me explain my problem.. I am building an uploader application using
twisted. I am using "Protocol" in both side. What is the best way to
seperate data?
When i try to call "self.transport.write(data)"  it doesnt send data
immediately, it is sending with some other datas whic i send them later. Why
doesnt it send, what for is it waiting?

when i some information data I am sending  with '\n' (there is no other '\n'
in my data) to separate it in the client side but it is getting really
complicated. When i start to send file there is no problem, first send
fileSize then read everything and write in a file till fileSize.

I saw FileWrapper in the api but i couldnt find any tip that how it works,
is it for sending file, is it right way to my goal?

What about sending data like HTTP? What do you think about this way?
8 #bytes of data
11111111 #data
3 #bytes of data
111 #data
0 #finished sending data

I need your suggestions all about these.
(some links, documents, tips would be great)

Aydın ŞEN

         Ege Üniversitesi
Uluslararası Bilgisayar Enstitüsü
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://twistedmatrix.com/pipermail/twisted-python/attachments/20081201/1e7ff89f/attachment.htm 

More information about the Twisted-Python mailing list