How do you guys feel about moving away select.select


#1

Just trying to figure out the best way to fix our problem, but I also want to add to the project. It looks like you guys use select.select in places as to keep compatibility, but this results in limitations within other OS such as the file handler only able to do about 1024 in a linux environment. It also is a bit slower for larger number of connections and a bunch of other things…

How would everyone feel about moving towards another method such as selectors module that way it can pick which one to use for the different type of OS instead?

https://docs.python.org/2/library/select.html
https://docs.python.org/3/library/selectors.html


#2

Heh, this is exactly what we ultimately want to fix with the sans-io branch.

If there’s a useful drop-in replacement for https://github.com/mitmproxy/mitmproxy/blob/master/mitmproxy/net/tcp.py#L228, I’m happy to merge a PR in the meantime. IIRC the selectors API does not really fit for what we are doing, but I’m happy to be convinced that that’s not the case. :slight_smile: