512
  5   ˆl–Ü4ý( ©¤ýÔâ�Æ…p)‹Fÿ�þB gŒË!eóÂƒh¹Ç¿Ä      online
     ˆÉÈÇ525Æ¿Ä     ‹      Õ•QoÓ0Çß÷)Œxk/éFÇ:Çh4•¨ÖµUW„BÈ‰ÝÆZbW¶ÛR>=N“Ò2­0ˆñäóåï»û]y�ºÓ÷ãz3½ ñÛ×ƒ~áÀ»Ó.@<�«gÍ è1Â™s‹Àz½n®O›ÚÌa:�ÌùXgdêšÜqLOHé£'ˆd‚q¿"â¤Ëí+.>#=C —ÎJ.ü¹�.V2¶´�( …6›zyÙ¥¹êíùØeR		TQ}¨‘DóM™?üã¹|È-K¶)KÓPâ2´b¹œ«;½À”ÈbŽ¬I#2ÕÊB’3u×œËF,wþÐïŽ>z¸¬<M	C™³¿êFÃËQc:d… ÀÖÜxÍ¦f*4—3)øQñm%¾•_ŽŒ+M,ljäÂI­öRðˆ‡¨©Îí‚yÖž 3‡ªJÂÖ–~×ŒñÕ¤7œÆýIÕ^†ØW÷;oÓ13B9K#Rç�5V•ã¹Jìâr·EuÑFÎ3‡)Bô òHg:çÂ²£Üqaº³+½WZ+hµaØ/PxÞ	Ú=#WÂljë©0,Õ�Òkuá?èA|bKÊèD|£Ù»�Õ
QÐî´‚£XþB½þX÷�þWœ¥XùßÓjýû �¼þ ¶#ˆ@5¿ïÿ+.e    7   ˆl–Ü4ý( ©¤ýÔâ�Æ…p@S�ÿ‘äÇò 8àôac#DþÃƒh¹ÈÀÅ      0
     ˆÊÉÈ597ÇÀÅ U    ‹      Õ–ßoÚ0ÇßûWx~ØÖªmðÔ¤¡Q@-Ó4MSebC¬&vd(ýëçà´M§¢Q­EíÓù’oîîãœ„¢QwòsÜC_'ç4þþeÐï"\øÑêD“È¿h×@oˆN¬ÍO V«U}Õª+=‡É$6KÛ`¬±­3Ë09‹gä …	§ÌYZaSNú’ñ¤fÔÂÁ¸ûnm€ñ¥ˆ¹)Æ–g�ñLéuiÚm�ŠñFé¶Ž¹Ç�|h—ÊláT±uQDð:	]Ü�nòCMB› %MÅ\v°U9&¡ÈæÈè¸ƒAÄJ˜¦T^×çb†MmÿêwG¿�lR|MBŠÍgü¹ÛžŽ:&CšñèÓšs§9Ãd@�E™bb&8Û*¾ôâKq»=`ä57±¹J>HÁ!VQc•šœ:ÖOŽ ÑU•—°Í�MÆøì¢7œDý?%¬ñPÝÿÿ>LÆTsiQ$4�­{UÂùLåÔä§w.*K×bžXLª¡'•Ïà�©”q]%ÞÆzW¯·Õ*ÿ*«ÙhÖ‚ £àè¤qˆÐ+Ö¿�×R­dÀµÃ“ J¦BrL¼Ý   uÒnnp[Ð·=äÉÚ\ù&Ã¤â¼WQì‚%ÉfüV@v_¹Zqí…·/Qÿž…vÛÑ²810¹¾•ßðc©uóVÊß½‹ÌbZžá~ü·Ø_º³o_`Ï}TbW·JrƒIÅyýžÚñåõ.„Ím2¥ýb*¶5        ˆ¾‘äÇò 8àôa]Œ"þÃƒh¹ÈÀÅ      1280
  C   ˆl–Ðz¾”Šj"Tâ‚À½q¶”Å£�þYy—Vq²‘¸Ý�Jð?ŸÄ„L¾É_ŠI|¥�+Wé3ž¯ÂÇ 87    """This class holds Cheroot WSGI server implementation.

Simplest example on how to use this server::

    from cheroot import wsgi

    def my_crazy_app(environ, start_response):
        status = '200 OK'
        response_headers = [('Content-type','text/plain')]
        start_response(status, response_headers)
        return [b'Hello world!']

    addr = '0.0.0.0', 8070
    server = wsgi.Server(addr, my_crazy_app)
    server.start()

The Cheroot WSGI server can serve as many WSGI applications
as you want in one instance by using a PathInfoDispatcher::

    path_map = {
        '/': my_crazy_app,
        '/blog': my_blog_app,
    }
    d = wsgi.PathInfoDispatcher(path_map)
    server = wsgi.Server(addr, d)
"""

import contextlib
import sys

from . import server
from ._compat import bton, ntob
from .workers import threadpool


class Server(server.HTTPServer):
    """A subclass of HTTPServer which calls a WSGI application."""

    wsgi_version = (1, 0)
    """The version of WSGI to produce."""

    def __init__(  # pylint: disable=too-many-positional-arguments
        self,
        bind_addr,
        wsgi_app,
        numthreads=10,
        server_name=None,
        max=-1,
        request_queue_size=5,
        timeout=10,
        shutdown_timeout=5,
        accepted_queue_size=-1,
        accepted_queue_timeout=10,
        peercreds_enabled=False,
        peercreds_resolve_enabled=False,
        reuse_port=False,
    ):
        """Initialize WSGI Server instance.

        Args:
            bind_addr (tuple): network interface to listen to
            wsgi_app (callable): WSGI application callable
            numthreads (int): number of threads for WSGI thread pool
            server_name (str): web server name to be advertised via
                Server HTTP header
            max (int): maximum number of worker threads
            request_queue_size (int): the 'backlog' arg to
                socket.listen(); max queued connections
            timeout (int): the timeout in seconds for accepted connections
            shutdown_timeout (int): the total time, in seconds, to
                wait for worker threads to cleanly exit
            accepted_queue_size (int): maximum number of active
                requests in queue
            accepted_queue_timeout (int): timeout for putting request
                into queue
        """
        super(Server, self).__init__(
            bind_addr,
            gateway=wsgi_gateways[self.wsgi_version],
            server_name=server_name,
            peercreds_enabled=peercreds_enabled,
            peercreds_resolve_enabled=peer