diff --git a/sanic/sanic.py b/sanic/sanic.py index 22ed234e..a3f49197 100644 --- a/sanic/sanic.py +++ b/sanic/sanic.py @@ -242,7 +242,7 @@ class Sanic: def run(self, host="127.0.0.1", port=8000, debug=False, before_start=None, after_start=None, before_stop=None, after_stop=None, sock=None, - workers=1, loop=None, protocol=HttpProtocol): + workers=1, loop=None, protocol=HttpProtocol, backlog=100): """ Runs the HTTP Server and listens until keyboard interrupt or term signal. On termination, drains connections before closing. @@ -278,7 +278,8 @@ class Sanic: 'error_handler': self.error_handler, 'request_timeout': self.config.REQUEST_TIMEOUT, 'request_max_size': self.config.REQUEST_MAX_SIZE, - 'loop': loop + 'loop': loop, + 'backlog': backlog } # -------------------------------------------- # diff --git a/sanic/server.py b/sanic/server.py index e789f173..ec207d26 100644 --- a/sanic/server.py +++ b/sanic/server.py @@ -226,7 +226,7 @@ def trigger_events(events, loop): def serve(host, port, request_handler, error_handler, before_start=None, after_start=None, before_stop=None, after_stop=None, debug=False, request_timeout=60, sock=None, request_max_size=None, - reuse_port=False, loop=None, protocol=HttpProtocol): + reuse_port=False, loop=None, protocol=HttpProtocol, backlog=100): """ Starts asynchronous HTTP Server on an individual process. :param host: Address to host on @@ -276,7 +276,8 @@ def serve(host, port, request_handler, error_handler, before_start=None, host, port, reuse_port=reuse_port, - sock=sock + sock=sock, + backlog=backlog ) # Instead of pulling time at the end of every request,