does pauseProducing() in Twisted guarantee no more calls to dataReceived()?

女生的网名这么多〃 提交于 2020-01-05 04:22:30

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!