English 中文(简体)
UDP 流动控制
原标题:UDP flow control with Python Twisted

我有一个从<代码>上继承的班子。 班级。 在我的<代码>启动(议定书)执行 我请<条码>启程/代码>,这样,每当我能够给它写信时,便可以向它发出记票,而不会阻挡。 两个问题:

  1. Which method twisted will call once socket will become writable?
  2. How should I call startWriting() method, if it needs to be called on particular time-intervals to limit the outgoing UDP bandwidth to particular Datagrams/Second amount?
最佳回答

Oops. I think I may have answered your question in another thread and lead you to believe that UDP flow control support in Twisted is a little more robust than it actually is. Nevertheless, you can get what you need to do done...

1. Which method will Twisted call once socket will become writable?

不幸的是,土耳其民主力量联盟在Twisted签订的协议并未因真实性而得到监测,其前提是民主力量联盟永远不会失败,因此它永远不应提出<条码>。 (实际上,它有时使用,,这是我在回答这一问题时再次发现的Twisted中的ug。 只有当Twisted以比当地电线速度更快的速度运送民主人民党时,才会出现这种情况,这需要非常迅速的申请和非常缓慢的网络。

作为一种工作,你的申请只能打上<>EWOULDBLOCK。 对于任何其他议定书来说,这种工作方式可能构成一个严重问题,但就民盟而言,你已经必须准备失去任何即将离开的包裹,因此,你需要一个逐个控制流动的机制。

帮助我们获得,即bug通过也始终是一种选择。

If you want to get really fancy, you can write your own alternative to udp.Port (by implementing IFileDescriptor yourself) rather than writing a UDP protocol, and override doRead and doWrite (which are called when the underlying socket is readable and writable respectively). This will give you perfect write-level flow control, but probably isn t necessary since, again, UDP will just drop your packets sometimes, and on networks without the ability to properly process "ICMP source quench" messages (which dumb firewalls configured to block ICMP will just block), dropped packets are your only source of flow control information. I m not saying that you shouldn t fix this bug in Twisted for real, but this fact of life in the UDP world is the likely reason that nobody has bothered to do so yet.

2. How should I call startWriting() method, if it needs to be called on particular time-intervals to limit the outgoing UDP bandwidth to particular Datagrams/Second amount?

由于本答复第1部分所述限制,UDP的运输没有有用的<条码>启程/代码>方法。

然而,startWriting/> 确实是确定你即将离任的民主人民党带宽的正确途径。

Simply打上sol.transport.write(......),在适当时间安排机制下接通电话之后,,LoopingCall ,例如,目的是在适当的间隔中为传输音响媒体发出信号。 但是,你也只能计算自己的拖延和使用。 无论如何,如果你需要重新翻译被排出的、用于运输超低温和高原的数据,那么你很可能需要保持某种排泄机制。

如果需要<><>有<>限制>的>流动控制,则UDP的运输仍然支持:完全是,有>>>>>>>>>>>>>>>>> 阻碍Reading>>>和

我希望这一答案是有助益的,如果我以前误导你,了解这方面的 T智能力,那是令人不安的。

问题回答

暂无回答




相关问题
Can Django models use MySQL functions?

Is there a way to force Django models to pass a field to a MySQL function every time the model data is read or loaded? To clarify what I mean in SQL, I want the Django model to produce something like ...

An enterprise scheduler for python (like quartz)

I am looking for an enterprise tasks scheduler for python, like quartz is for Java. Requirements: Persistent: if the process restarts or the machine restarts, then all the jobs must stay there and ...

How to remove unique, then duplicate dictionaries in a list?

Given the following list that contains some duplicate and some unique dictionaries, what is the best method to remove unique dictionaries first, then reduce the duplicate dictionaries to single ...

What is suggested seed value to use with random.seed()?

Simple enough question: I m using python random module to generate random integers. I want to know what is the suggested value to use with the random.seed() function? Currently I am letting this ...

How can I make the PyDev editor selectively ignore errors?

I m using PyDev under Eclipse to write some Jython code. I ve got numerous instances where I need to do something like this: import com.work.project.component.client.Interface.ISubInterface as ...

How do I profile `paster serve` s startup time?

Python s paster serve app.ini is taking longer than I would like to be ready for the first request. I know how to profile requests with middleware, but how do I profile the initialization time? I ...

Pragmatically adding give-aways/freebies to an online store

Our business currently has an online store and recently we ve been offering free specials to our customers. Right now, we simply display the special and give the buyer a notice stating we will add the ...

Converting Dictionary to List? [duplicate]

I m trying to convert a Python dictionary into a Python list, in order to perform some calculations. #My dictionary dict = {} dict[ Capital ]="London" dict[ Food ]="Fish&Chips" dict[ 2012 ]="...

热门标签