관리-도구
편집 파일: _trio_backend.cpython-38.pyc
U /?�fM � @ s d Z ddlZddlZddlZddlZddlZddlZddlZej � d�sPed��dd� Zej jZG dd� dejj�ZG d d � d ejj�Zej � d�r�ddlZddlZddlZejZejjjZddlmZmZmZ G d d� de�ZG dd� dej �Z!nejj"Z!G dd� dejj#�Z#dS )z$trio async I/O library query support� N�trioztrio not found or too oldc C s | d k rt �| �S tj�� S d S �N)r Z move_on_after�dns� _asyncbackendZNullContext��timeout� r �?/opt/hc_python/lib/python3.8/site-packages/dns/_trio_backend.py�_maybe_timeout s r c sL e Zd Z� fdd�Zdd� Zdd� Zdd� Zd d � Zdd� Zd d� Z � Z S )�DatagramSocketc s t � �|j� || _d S r )�super�__init__�family�socket)�selfr �� __class__r r r ! s zDatagramSocket.__init__c � sB t |��" | j�||�I d H W 5 Q R � S Q R X tjj|d��d S �Nr )r r �sendtor � exception�Timeout)r �what�destinationr r r r r % s &�zDatagramSocket.sendtoc � s@ t |�� | j�|�I d H W 5 Q R � S Q R X tjj|d��d S r )r r �recvfromr r r �r �sizer r r r r , s $zDatagramSocket.recvfromc � s | j �� d S r )r �close�r r r r r 1 s zDatagramSocket.closec � s | j �� S r )r �getpeernamer r r r r 4 s zDatagramSocket.getpeernamec � s | j �� S r )r �getsocknamer r r r r 7 s zDatagramSocket.getsocknamec � s t �d S r ��NotImplementedError�r r r r r �getpeercert: s zDatagramSocket.getpeercert)�__name__� __module__�__qualname__r r r r r r r# � __classcell__r r r r r s r c @ sF e Zd Zddd�Zdd� Zdd� Zdd � Zd d� Zdd � Zdd� Z dS )�StreamSocketFc C s || _ || _|| _d S r )r �stream�tls)r r r) r* r r r r ? s zStreamSocket.__init__c � s@ t |�� | j�|�I d H W 5 Q R � S Q R X tjj|d��d S r )r r) Zsend_allr r r )r r r r r r �sendallD s $zStreamSocket.sendallc � s@ t |�� | j�|�I d H W 5 Q R � S Q R X tjj|d��d S r )r r) Zreceive_somer r r r r r r �recvI s $zStreamSocket.recvc � s | j �� I d H d S r )r) �acloser r r r r N s zStreamSocket.closec � s$ | j r| jjj�� S | jj�� S d S r )r* r) �transport_streamr r r r r r r Q s zStreamSocket.getpeernamec � s$ | j r| jjj�� S | jj�� S d S r )r* r) r. r r r r r r r W s zStreamSocket.getsocknamec � s<