English 中文(简体)
灰色:“在选择(......)范围外的描述”
原标题:Python asyncore: "filedescriptor out of range in select()"

I have some python script with more than 3k outgoing socket connections, based on asyncore lib. I can t use select(..) due to connections limit (1024), but poll(..) not working properly too:

asyncore.loop(use_poll=True)

我这样说,就忽视了任何事情。 请注意,1024个出租车上的选择()将进行罚款。

我的问题在哪里?

最佳回答

第一,略作更正。 。 它导致它使用poll(2)(更不用说作为同级工程,没有什么理由试图使用epoll(2),因为作为同值的沙捞越层间接费用超过了使用A/60/8号事件通知的任何费用)。

Second, a major shortcoming of asyncore is the degree to which it exposes you to platform-specific quirks. For a library that handles more of the differences between select(2) and poll(2) for you, and which actually supports epoll(2), and which is better in a number of other ways too, check out Twisted.

如果你能够,就你的问题提供更多细节,或许可以发现你在作为同分上遇到的具体问题,但根据现在掌握的信息,是无法肯定的。 作为同分的poll(2)支持的基本特点确实是行之有效的——例如,它可以在三维案件中提供读写和贴切通知。 您的案件与三维案件有何不同?

问题回答

暂无回答




相关问题
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 ]="...

热门标签