[Twisted-Python] Server/Client bi-directional data-transfer - need a solution

Andrew Bennetts andrew-twisted at puzzling.org
Tue Dec 18 16:24:20 MST 2007


Sajit Rao wrote:
> Thanks for your reply, Maarten.
> 
> I'm still chewing over it. In answer to your questions:
> 
> I will be sending short strings between client and server (bi-directionally)
> most of the time (> 100 times a day) and ocassionaly files (each of size 5 MB
> or less and > 10 but <100 times a day).
> 
> I wouldn't mind sending strings or files along the same channel - but I don't
> know how to do that
> 
> While I like the brevity of python and realize that Twisted deffereds are the
> heart of the async model,  I'm hampered by the scant documentation and code
> fragments.
> 
> Could someone point me to how to send raw strings or binary files over the same
> channel and have the other side interpret the data correctly?

This is really a protocol design question rather than Twisted-specific question.

You might find Itamar's series of articles on protocol design to be helpful:

http://webservices.xml.com/pub/a/ws/2003/11/25/protocols.html
http://webservices.xml.com/pub/a/ws/2004/01/20/sessions.html
http://webservices.xml.com/pub/a/ws/2004/02/25/protocols3.html
http://webservices.xml.com/pub/a/ws/2004/04/21/protocols.html
http://www.xml.com/pub/a/ws/2004/08/25/dprotocol.html

(You can find these and other writings at http://www.itamarst.org/)

-Andrew.





More information about the Twisted-Python mailing list