[Twisted-Python] New client APIs

Hi, I just checked in a new API for client connections (TCP/SSL/UNIX.) The main change is that you now register a ClientFactory using reactor.connectTCP (or Application.connectTCP). Various callbacks will get called on the factory, allowing you to reconnect on a failure or lost connection, let users abort connections, and so on. So, these policies are now done in the *factory* - connectionFailed will no longer be called on protocols unless you use the old deprecated APIs. So what does this mean to you? If you are a Twisted developer, please take a look and see if you have any further needs or issues with the implementation. If all goes well (and this is the second refactoring I've done, I don't expect many changes) we need to start updating all the code to use the new APIs. For example, FTP tests are failing right now, due to my not making the backwards compatability code totally backwards compatible. This is fine by me - the new API is much nicer and will make everyone's life easier, so it's not worth the time making the old API work exactly the same. Documentation can be found by looking at: IConnector, protocol.ClientFactory, IReactorTCP.connectTCP

On Sat, Jul 27, 2002 at 07:26:29PM -0400, Itamar Shtull-Trauring wrote:
For example, FTP tests are failing right now, due to my not making the
Ah, FTP failing again :) FTP seems to be the Twisted canary -- it's always the first to break...
I've taken a look at the documentation, but I'm not certain of the best way to proceed to fix FTP. FTP doesn't want any sort of reconnection funny-business going on. If the data connection fails, I just want to know about that and send an error message, rather than do any sort of reconnection. reactor.clientTCP used to do that. I'm not sure what the equivalent now is? Do I need to make a ClientFactory subclass that implements these "try once then give up" sematics? If so, should that be a standard utility class? I get the feeling that the answer is quite simple and staring me in the face, so please tell me what it is :) -Andrew.

On Sat, 27 Jul 2002 19:26:29 -0400, Itamar Shtull-Trauring <twisted@itamarst.org> wrote:
Okay, this is fixed now. Soon, I'm going to hack in support to acapnotic's CVSToys to run the unit tests on the HEAD branch and e-mail checkin offenders once an hour until they get fixed. Until I do that, though, I will sporadically emulate that functionality manually; expect to have a full mailbox if you don't check that unit tests are still working (backwards compatibility hacks or no!). ;-) -- | <`'> | Glyph Lefkowitz: Traveling Sorcerer | | < _/ > | Lead Developer, the Twisted project | | < ___/ > | http://www.twistedmatrix.com |

On Sat, Jul 27, 2002 at 07:26:29PM -0400, Itamar Shtull-Trauring wrote:
For example, FTP tests are failing right now, due to my not making the
Ah, FTP failing again :) FTP seems to be the Twisted canary -- it's always the first to break...
I've taken a look at the documentation, but I'm not certain of the best way to proceed to fix FTP. FTP doesn't want any sort of reconnection funny-business going on. If the data connection fails, I just want to know about that and send an error message, rather than do any sort of reconnection. reactor.clientTCP used to do that. I'm not sure what the equivalent now is? Do I need to make a ClientFactory subclass that implements these "try once then give up" sematics? If so, should that be a standard utility class? I get the feeling that the answer is quite simple and staring me in the face, so please tell me what it is :) -Andrew.

On Sat, 27 Jul 2002 19:26:29 -0400, Itamar Shtull-Trauring <twisted@itamarst.org> wrote:
Okay, this is fixed now. Soon, I'm going to hack in support to acapnotic's CVSToys to run the unit tests on the HEAD branch and e-mail checkin offenders once an hour until they get fixed. Until I do that, though, I will sporadically emulate that functionality manually; expect to have a full mailbox if you don't check that unit tests are still working (backwards compatibility hacks or no!). ;-) -- | <`'> | Glyph Lefkowitz: Traveling Sorcerer | | < _/ > | Lead Developer, the Twisted project | | < ___/ > | http://www.twistedmatrix.com |
participants (3)
-
Andrew Bennetts
-
Glyph Lefkowitz
-
Itamar Shtull-Trauring