ok
Direktori : /opt/alt/python38/lib64/python3.8/site-packages/aiohttp/__pycache__/ |
Current File : //opt/alt/python38/lib64/python3.8/site-packages/aiohttp/__pycache__/resolver.cpython-38.pyc |
U '�7` � @ s� d dl Z d dlZd dlmZmZmZmZ ddlmZ ddl m Z dZzd dlZW n e k rh dZY nX dZG dd � d e�ZG d d� de�Zer�eneZdS )� N)�Any�Dict�List�Optional� )�AbstractResolver)�get_running_loop)�ThreadedResolver� AsyncResolver�DefaultResolverFc @ s^ e Zd ZdZd eej dd�dd�Zdej fe eeee e ef d�dd �Zdd �dd�ZdS )r zsUse Executor for synchronous getaddrinfo() calls, which defaults to concurrent.futures.ThreadPoolExecutor. N)�loop�returnc C s t |�| _d S �N)r �_loop)�selfr � r �C/opt/alt/python38/lib64/python3.8/site-packages/aiohttp/resolver.py�__init__ s zThreadedResolver.__init__r )�hostname�port�familyr c � s� | j j||tj|tjd�I d H }g }|D ]r\}}}}}|tjkrj|d rjt�|tjtjB �\} } t | �}n|d d� \} }|� || |||tjtjB d�� q(|S )N)�typer �flags� � �r �hostr r �protor ) r Zgetaddrinfo�socketZSOCK_STREAMZ AI_ADDRCONFIG�AF_INET6ZgetnameinfoZNI_NUMERICHOSTZNI_NUMERICSERV�int�append�AI_NUMERICHOST�AI_NUMERICSERV)r r r r Zinfos�hosts�_r �addressr Z_portr r r �resolve s4 � � ��zThreadedResolver.resolve�r c � s d S r r �r r r r �close@ s zThreadedResolver.close)N)�__name__� __module__�__qualname__�__doc__r �asyncio�AbstractEventLoopr r �AF_INET�strr r r r r'