问题
This is an extension of my question here: python twisted: enforcing a single connection per id
I'm trying to enforce a singe connection per id. If a new connection comes in with the same id as an existing connection, I try to kill the old one and replace it with the new one. I do that by pausing the new one, killing the old one, then un-pausing the new one. I made the assumption that after pausing the transport on a connection I wouldn't get any further calls to dataReceived()
but this doesn't seem to be the case.
In my logs, I recorded where I pauseProducing
in the dataReceived
method and then return. Immediately (1ms!) after I have a second call to the dataReceived
on the same object with no calls to un-pause the production.
Are my assumptions incorrect about no more calls to dataReceived
after pauseProducing
or have I found a bug?
回答1:
Assuming that your program is working as you describe, then yes, this is a bug. Please file it on https://twistedmatrix.com/trac/newticket .
来源:https://stackoverflow.com/questions/29351778/does-pauseproducing-in-twisted-guarantee-no-more-calls-to-datareceived