[Twisted-Python] Streaming File Transfer Protocol?

2010-02-10 Thread Darren Govoni
Hi, Is there an existing protocol that can provide the following? - Accept stream binary data FROM a client (e.g. very large file transfer) - Receive data IN ORDER (i.e. stream. not out of order random packets) I want to stream FROM a client to the protocol server and have the server process th

[Twisted-Python] Error handling for modules which use twisted.enterprise.adbapi

2010-02-10 Thread Vishal Shetye
Hi, I have an application that uses twisted.enterprise.adbapi for accessing sqlite database. Recently I had to replace sqlite3 shipped with python 2.5 with latest version of pysqlite2. This was for taking advantage of newer fixes in pysqlite2. I thought it would be worthwhile to support both. How

Re: [Twisted-Python] Streaming File Transfer Protocol?

2010-02-10 Thread Marco Giusti
On Wed, Feb 10, 2010 at 12:22:59PM -0500, Darren Govoni wrote: > Hi, > Is there an existing protocol that can provide the following? > > - Accept stream binary data FROM a client (e.g. very large file > transfer) HTTP and FTP just to say two of many, > - Receive data IN ORDER (i.e. stream. not

Re: [Twisted-Python] Streaming File Transfer Protocol?

2010-02-10 Thread Mark Bailey
Hi Darren: Why not use TCP? You can send the length of the file at the beginning so you know how many bytes to listen for. TCP guarantees delivery and ordering. Mark On Wed, Feb 10, 2010 at 12:22 PM, Darren Govoni wrote: > Hi, > Is there an existing protocol that can provide the following?

Re: [Twisted-Python] Streaming File Transfer Protocol?

2010-02-10 Thread Darren Govoni
Hey Mark, Yeah, that's what I want, but in the 'twisted' way. I can write socket servers, etc. But didn't notice a good example of how to do this in Twisted (sparing me the socket programming), until I found this old message[1] with the classes I think might work. [1] http://twistedmatrix.com/

[Twisted-Python] How can I send unique configuration data for multiple connections through a factory?

2010-02-10 Thread Mark Bailey
Good day: I've been having fun with Twisted. I have my application running fine, with multiple server and client connections using Telnet. :-) However, users always want something. I need to send some unique configuration information to each connection. The connections are made using connectT

Re: [Twisted-Python] newbie confusion - puzzling reactor response

2010-02-10 Thread Mark Bailey
Hi: Aren't you adding two readers? One is added in the __init__ method of inputFile, the other in the test code. I'm also a newbie so maybe I'm equally confused... On Tue, Feb 9, 2010 at 8:47 PM, K. Richard Pixley wrote: > I'm confused be the response I get to the attached program. > > In a

Re: [Twisted-Python] Streaming File Transfer Protocol?

2010-02-10 Thread Mark Bailey
How about: # Copyright (c) 2001-2004 Twisted Matrix Laboratories. # See LICENSE for details. """ An example client. Run simpleserv.py first before running this. """ from twisted.internet import reactor, protocol # a client protocol class EchoClient(protocol.Protocol): """Once connected,

Re: [Twisted-Python] Light-est-weight http authentication

2010-02-10 Thread Brad Milne
Thanks. I had actually already found your page and you're right, it does seem to be the best resource out there. Since your email I've had a second look at it, as initially I wasn't sure how to use the example to return a web resource (handler with render_GET etc) in place of the file you returned.

Re: [Twisted-Python] Streaming File Transfer Protocol?

2010-02-10 Thread Darren Govoni
>From what I learned in other posts, the dataReceived(self, data): in the Echo server will get called with out-of-order data/bytes from the client. Of course, I could be misinformed, but what I understood before was that in this type of Protocol, I would have to re-order and re-assemble the bytes.

Re: [Twisted-Python] newbie confusion - puzzling reactor response

2010-02-10 Thread K. Richard Pixley
I don't think so. I believe the reactor is actually added during the import. (I learned this as I discovered that reactors can't be restarted, which means you have to manually create a new one as a fixture for simple unittest work.) I looked through the code and there's a call in the reactor

Re: [Twisted-Python] How can I send unique configuration data for multiple connections through a factory?

2010-02-10 Thread Arjan Scherpenisse
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 If you create two instances of your ClusterClientFactory, each with a unique string, you should be fine. Requires only a small modification: factory = ClusterClientFactory() factory.maxDelay = 120 # two minutes factory.con

Re: [Twisted-Python] newbie confusion - puzzling reactor response

2010-02-10 Thread Mark Bailey
Hi Rich: Try removing the "reactor.addReader(self)" call from "__init__" and see what happens. That call is made when "r" is created in r = inputFile('/etc/group') and immediately after that you are calling reactor.addReader(r) So, you are calling reactor.addReader() twice on the same in

Re: [Twisted-Python] Light-est-weight http authentication

2010-02-10 Thread Brad Milne
End of trace is: File "C:\Python26\lib\site-packages\twisted\web\resource.py", line 189, in render raise UnsupportedMethod(getattr(self, 'allowedMethods', ())) twisted.web.server.UnsupportedMethod: () On 11 February 2010 08:20, Brad Milne wrote: > Thanks. I had actually already found your

Re: [Twisted-Python] Light-est-weight http authentication

2010-02-10 Thread Brad Milne
Haha, resolved now. Previously my setup wasn't sensitive to a missing trailing slash on my PUT and POSTs, but now it is. I don't know why, but at least it's solvable. Thanks for the help Brad On 11 February 2010 08:59, Brad Milne wrote: > End of trace is: > File "C:\Python26\lib\site-packages

Re: [Twisted-Python] newbie confusion - puzzling reactor response

2010-02-10 Thread K. Richard Pixley
Doh. You're right about the double registration. Thanks. But that doesn't change my problem. The reactor still complains about the busted descriptor after removing the reader and reseting my descriptor to -1. --rich Mark Bailey wrote: Hi Rich: Try removing the "reactor.addReader(self)"

Re: [Twisted-Python] Streaming File Transfer Protocol?

2010-02-10 Thread exarkun
On 07:23 pm, dar...@ontrenet.com wrote: >> From what I learned in other posts, the dataReceived(self, data): in >>the >Echo server >will get called with out-of-order data/bytes from the client. Of >course, >I could be misinformed, >but what I understood before was that in this type of Protocol, I

Re: [Twisted-Python] newbie confusion - puzzling reactor response

2010-02-10 Thread exarkun
On 07:24 pm, r...@noir.com wrote: >I don't think so. I believe the reactor is actually added during the >import. (I learned this as I discovered that reactors can't be >restarted, which means you have to manually create a new one as a >fixture for simple unittest work.) > >I looked through the

Re: [Twisted-Python] Streaming File Transfer Protocol?

2010-02-10 Thread David Bolen
Darren Govoni writes: >>From what I learned in other posts, the dataReceived(self, data): in the > Echo server > will get called with out-of-order data/bytes from the client. Of course, > I could be misinformed, > but what I understood before was that in this type of Protocol, I would > have to r

Re: [Twisted-Python] How can I send unique configuration data for multiple connections through a factory?

2010-02-10 Thread Mark Bailey
Thanks, Arjan. Of course, factories are breeding like rabbits, but that was the obvious solution! :-) I wish I had thought of it. You saved me several MORE hours...I've spend all day on this. (It's snowing and work was CLOSED! Yeehah!) Mark On Wed, Feb 10, 2010 at 2:38 PM, Arjan Scherpeniss

Re: [Twisted-Python] Streaming File Transfer Protocol?

2010-02-10 Thread Darren Govoni
Thanks for that explanation David. Makes sense! On Wed, 2010-02-10 at 16:01 -0500, David Bolen wrote: > Darren Govoni writes: > > >>From what I learned in other posts, the dataReceived(self, data): in the > > Echo server > > will get called with out-of-order data/bytes from the client. Of cour