[Twisted-Python] timeout and retries
andrew-twisted at puzzling.org
Sat Jun 18 06:34:49 EDT 2005
On Fri, Jun 17, 2005 at 04:41:17PM +0200, Stefano Canepa wrote:
> The following code is a try to write a protocol with timeout and
> retries. The connectioMade is used only as a test. I have some problems:
> 1) even if I placed "\x01" as delimiter the line is sent not terminated
> def sendLine(self, msg):
> Add <SB> (\x01 i.e. SOH) at the start of message as required by
> HL7 standard and send the message
> msgToSend = "\x01"+msg
> print msgToSend
> print "written"
You've overridden LineReceiver's sendLine to ignore the delimiter attribute.
> 2) even if timeout expired 3 times the success callback is called
> d = defer.Deferred()
Read the description of how callback/errback chains work again:
You probably meant:
d = defer.Deferred()
Which has a subtly different meaning.
More information about the Twisted-Python