<div dir="ltr"><blockquote>I think so -- you wont be told when the actual bytes have been pushed<br>
onto the network, nor when they have arrived succesfully at their<br>
destination. You have to add such logic yourself, maybe by having the<br>
recepient send back a confirmation.<br><br>
So one way to structure this is to let the code that calls<br>
transport.write return a Deferred, call it d. Before returning it, the<br>
code stores d in a well-known place, something like<br><br>
transport.write(...)<br>
d = Deferred()<br>
outstanding requests[some_id] = d<br>
return d<br><br>
The code that handles incoming data will then have to recognize the<br>
confirmation and will invoke the callback method on d:<br><br>
def dataReceived(self, data):<br>
id, payload = unpack(data)<br>
d = outstanding_requests[id]<br>
d.callback(payload)<br><br>
This is sort of how my code works in the VIFF project.<br><div class="Ih2E3d"><br>
> By the way I did find your example, but I could not reconcile why<br>
> some deferred examples had 'automatic' callbacks and other fired<br>
> their own.<br>
<br>
</div>That is because of the different ways they are used: Defered is the<br>
basic building block, but DeferredList combines several Deferreds into<br>
one.<br><br>Martin<br><br>Thankyou very much for your replies.<br><br>I have a feeling that I now know what I am doing or going to do.<br><br>I also think your min-deferred example will be very useful.<br><br>Thanks once again.<br>
<br>John Aherne<br><br></blockquote>
</div>