A generic TCP server. Accepts connections on a listening socket and spawns user-provided handle for each connection with 2 arguments: the client socket and the client address.
If any of the following keyword arguments are present, then the server assumes SSL mode and uses these arguments to create an SSL wrapper for the client socket before passing it to handle:
Note that although the errors in a successfully spawned handler will not affect the server or other connections, the errors raised by accept() and spawn cause the server to stop accepting for a short amount of time. The exact period depends on the values of min_delay and max_delay attributes.
The delay starts with min_delay and doubles with each successive error until it reaches max_delay. A successful accept() resets the delay to min_delay again.
Next page: gevent.pywsgi