Trio strategy to handle incoming connections in serve_tcp

That’s correct, Trio doesn’t have any built-in mechanism to limit the number of concurrent connections.

That’s interesting that gevent has a feature like that – it’s not something I’ve seen in other libraries. (I know that least asyncio, Twisted, Tornado, and libuv are similar to Trio, and don’t have anything like that built-in.)

So of course this does mean that if you blast too many incoming connections at a program written with one of those frameworks, then they’ll eventually fall over. But… I don’t think adding a maximum connection limit is very effective at solving that. There’s some more discussion of this here: https://github.com/python-trio/trio/issues/636#issuecomment-589437971

2 Likes