Klaus Demo ~jonashaag/bjoern / d1fe3b7
PEP8 fixes Fabien MARTY 1 year, 6 months ago
1 changed file(s) with 6 addition(s) and 4 deletion(s). Raw diff Collapse all Expand all
2222 sock.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)
2323 if reuse_port:
2424 # Enable "receive steering" on FreeBSD and Linux >=3.9. This allows
25 # multiple independent bjoerns to bind to the same port (and ideally
26 # also set their CPU affinity), resulting in more efficient load
27 # distribution. https://lwn.net/Articles/542629/
25 # multiple independent bjoerns to bind to the same port (and
26 # ideally also set their CPU affinity), resulting in more efficient
27 # load distribution. https://lwn.net/Articles/542629/
2828 sock.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEPORT, 1)
2929 sock.bind((host, port))
3030
5151 sock = bind_and_listen(host, port, reuse_port)
5252 _default_instance = (sock, wsgi_app)
5353
54
5455 def run(*args, **kwargs):
5556 """
5657 run(*args, **kwargs):
6970 # Called as `bjoern.run()`
7071 if not _default_instance:
7172 raise RuntimeError("Must call bjoern.listen(wsgi_app, host, ...) "
72 "before calling bjoern.run() without arguments.")
73 "before calling bjoern.run() without "
74 "arguments.")
7375
7476 sock, wsgi_app = _default_instance
7577 try: