[Twisted-Python] Sending jpeg data over TCP/IP

Alexandre Quessy alexandre at quessy.net
Sun Feb 14 11:22:03 MST 2010


Hello again,
I've just read the HTTP PUT proposal email. I think it's a great idea.
Avoid reinventing the wheel, whenever possible !
Alternatively, sending only the file name could work if the client
then GET the file from an HTTP server that serves static files.

Using Nevow:
from nevow import static
...
self.child_files = static.File(self.static_files_path)

(see my media RSS server in
http://bitbucket.org/aalex/toonfeed/src/tip/toonfeed/web.py ... which
is not in a working state right now)

How can I server static files like this, not using nevow?

a


2010/2/14 Alexandre Quessy <alexandre at quessy.net>:
> Hello again everyone,
> Maybe using two senders/receivers would help. The control protocol,
> which can use XML or JSON, or whatever, would identify the files by
> their md5 sum? The file transfert protocol would detect the header of
> each file to separate them.
>
> a
>
> gary clark wrote:
>> There are probably several way to accomplish this I just needed to think about it a wee bit longer. One way would be to prepend an identifier to the file,strip the header from the raw data on reception and then save the image. I dont think its complicated. I may need a seperate server to handle the files though.
>>
>> Thanks,
>> Garyc
>>
>> --- On Sat, 2/13/10, Maarten ter Huurne <maarten at treewalker.org> wrote:
>>
>>> From: Maarten ter Huurne <maarten at treewalker.org>
>>> Subject: Re: [Twisted-Python] Sending jpeg data over TCP/IP
>>> To: "Twisted general discussion" <twisted-python at twistedmatrix.com>
>>> Date: Saturday, February 13, 2010, 6:07 PM
>>> On Sunday 14 February 2010, Alexandre
>>> Quessy wrote:
>>>
>>>> This said, sending them using a programmer's solution
>>> - not a sysadmin
>>>> solution - would be closer to my own skills, so I am
>>> interested in
>>>> knowing if this could be suitable. I think, though,
>>> that it would be
>>>> faster to use a transfert protocol that would be
>>> implemented in C, not
>>>> Python. Am I wrong?
>>> I would suggest to implement it in Python first and then
>>> benchmark it. Maybe
>>> the simplest implementation is already fast enough. Maybe
>>> the bottleneck is
>>> the network or the disk you're writing to; in that case you
>>> would be better
>>> off upgrading your switches or buying an SSD instead of
>>> writing C code.
>>>
>>> Bye,
>>>         Maarten
>>>
>>> _______________________________________________
>>> Twisted-Python mailing list
>>> Twisted-Python at twistedmatrix.com
>>> http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python
>>>
>>
>>
>> _______________________________________________
>> Twisted-Python mailing list
>> Twisted-Python at twistedmatrix.com
>> http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python
>>
>
> _______________________________________________
> Twisted-Python mailing list
> Twisted-Python at twistedmatrix.com
> http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python
>



-- 
Alexandre Quessy
http://alexandre.quessy.net/




More information about the Twisted-Python mailing list