%PDF- <> %âãÏÓ endobj 2 0 obj <> endobj 3 0 obj <>/ExtGState<>/ProcSet[/PDF/Text/ImageB/ImageC/ImageI] >>/Annots[ 28 0 R 29 0 R] /MediaBox[ 0 0 595.5 842.25] /Contents 4 0 R/Group<>/Tabs/S>> endobj ºaâÚÎΞ-ÌE1ÍØÄ÷{òò2ÿ ÛÖ^ÔÀá TÎ{¦?§®¥kuµùÕ5sLOšuY>endobj 2 0 obj<>endobj 2 0 obj<>endobj 2 0 obj<>endobj 2 0 obj<> endobj 2 0 obj<>endobj 2 0 obj<>es 3 0 R>> endobj 2 0 obj<> ox[ 0.000000 0.000000 609.600000 935.600000]/Fi endobj 3 0 obj<> endobj 7 1 obj<>/ProcSet[/PDF/Text/ImageB/ImageC/ImageI]>>/Subtype/Form>> stream
a
�_gd* � @ s� d Z ddlmZ ddlmZ ddlmZ ddlZddlmZ ddlm Z ddlm
Z
dd lmZ dd
lmZ ddl
mZ ddlmZ dd
lmZ ddgZejdkr�dZndZdd� ZG dd� de�ZG dd� de�Zddefdd�Zddefdd�ZdS )zTCP/SSL server� )�print_function)�absolute_import)�divisionN)�error)�
SOL_SOCKET)�SO_REUSEADDR)�AF_INET)�
SOCK_DGRAM)�
BaseServer)�EWOULDBLOCK)�socket�StreamServer�DatagramServer�win32� c C s | S �N� )�sockr r �:/vddos/python/lib/python3.9/site-packages/gevent/server.py�_closing_socket s r c @ sl e Zd ZdZdZeZddd�Zedd� �Z d d
� Z
dd� Zd
d� Ze
ddd��Zdd� Zdd� Zdd� ZdS )r
a�
A generic TCP server.
Accepts connections on a listening socket and spawns user-provided
*handle* function for each connection with 2 arguments: the client
socket and the client address.
Note that although the errors in a successfully spawned handler
will not affect the server or other connections, the errors raised
by :func:`accept` and *spawn* cause the server to stop accepting
for a short amount of time. The exact period depends on the values
of :attr:`min_delay` and :attr:`max_delay` attributes.
The delay starts with :attr:`min_delay` and doubles with each
successive error until it reaches :attr:`max_delay`. A successful
:func:`accept` resets the delay to :attr:`min_delay` again.
See :class:`~gevent.baseserver.BaseServer` for information on defining the *handle*
function and important restrictions on it.
**SSL Support**
The server can optionally work in SSL mode when given the correct
keyword arguments. (That is, the presence of any keyword arguments
will trigger SSL mode.) On Python 2.7.9 and later (any Python
version that supports the :class:`ssl.SSLContext`), this can be
done with a configured ``SSLContext``. On any Python version, it
can be done by passing the appropriate arguments for
:func:`ssl.wrap_socket`.
The incoming socket will be wrapped into an SSL socket before
being passed to the *handle* function.
If the *ssl_context* keyword argument is present, it should
contain an :class:`ssl.SSLContext`. The remaining keyword
arguments are passed to the :meth:`ssl.SSLContext.wrap_socket`
method of that object. Depending on the Python version, supported arguments
may include:
- server_hostname
- suppress_ragged_eofs
- do_handshake_on_connect
.. caution:: When using an SSLContext, it should either be
imported from :mod:`gevent.ssl`, or the process needs to be monkey-patched.
If the process is not monkey-patched and you pass the standard library
SSLContext, the resulting client sockets will not cooperate with gevent.
Otherwise, keyword arguments are assumed to apply to :func:`ssl.wrap_socket`.
These keyword arguments may include:
- keyfile
- certfile
- cert_reqs
- ssl_version
- ca_certs
- suppress_ragged_eofs
- do_handshake_on_connect
- ciphers
.. versionchanged:: 1.2a2
Add support for the *ssl_context* keyword argument.
� N�defaultc K s� t j| |||d� zv|r`|�dd� d|v rF|�d�}|j| _|| _qfddlm} || _|| _nd | _|d ur�t| d�r�td��|| _ W n | �
� � Y n0 d S ) N)�handle�spawn�server_sideT�ssl_contextr )�wrap_socketr z5backlog must be None when a socket instance is passed)r
�__init__�
setdefault�popr �ssl_argsZ
gevent.ssl�hasattr� TypeError�backlog�close)�self�listenerr r# r r r r r r r r o s&