%PDF- %PDF-
Direktori : /lib/python3/dist-packages/twisted/internet/iocpreactor/__pycache__/ |
Current File : //lib/python3/dist-packages/twisted/internet/iocpreactor/__pycache__/abstract.cpython-312.pyc |
� Ϫ�f 3 � � � d Z ddlZddlmZ ddlmZmZmZ ddlm Z m Z mZ ddlm Z ddlmZmZ ddlmZ eej( ej* ej, ej. � G d � d e e� � Zd gZy)z Abstract file handle class � N)�implementer)�error� interfaces�main)�_ConsumerMixin�_dataMustBeBytes� _LogOwner)�iocpsupport)�ERROR_HANDLE_EOF�ERROR_IO_PENDING)�failurec �Z � e Zd ZdZdZdZdZdZdZdZ dZ dZd� Zd � Z d � Zd� Zd� Zd � Zd� Zd� Zd� Zd� ZdZdZdZdZdZdZdZd� Zd� Zd� Zd� Z d� Z!d� Z"d� Z#d� Z$d� Z%d� Z&d� Z'd� Z(dZ)dZ*dZ+d Z,d!Z-d,d"�Z.d#� Z/d$� Z0 e1jd e3jh � fd%�Z5d&� Z6d'� Z7d(� Z8d)� Z9d*� Z:d+� Z;y)-� FileHandlez< File handle that can read and write asynchronously � i FTr Nc �� � | j j | � | j s@| j s3d| _ | j j d| j � | _ y y y �NTr )�reactor�addActiveHandle�_readScheduled�reading� callLater�_resumeReading��selfs �G/usr/lib/python3/dist-packages/twisted/internet/iocpreactor/abstract.py�startReadingzFileHandle.startReading( sQ � ����$�$�T�*��"�"�4�<�<��D�L�"&�,�,�"8�"8��D�<O�<O�"P�D�� ,8�"� c �l � | j r!| j j � d | _ d| _ y �NF)r �cancelr r s r �stopReadingzFileHandle.stopReading. s, � �������&�&�(�"&�D����r c �n � d | _ | j � r| j s| j � y y y �N)r � _dispatchData�_readScheduledInOS�doReadr s r r zFileHandle._resumeReading4 s0 � �"��������(?�(?��K�K�M� )@�r c � � | j s| j S | j }|| j z }| j |k rZ| j | j | j � | xj dz c_ | j sy| j |k r�Z|| j z }|r!| j | j | d| � | j r�| j t | j � z }||| j z k r| j d= nU||k( rPt | j � | j k r.| j j t | j � � d| _ d| _ | j S )zt Dispatch previously read data. Return True if self.reading and we don't have any more data � Fr ���)� _readSizer �readBufferSize�_readNextBuffer�dataReceived�_readBuffers�dynamicReadBuffers�len�maxReadBuffers�append� bytearray)r �size�full_buffers� remainder�total_buffer_sizes r r$ zFileHandle._dispatchData9 s^ � � �~�~��<�<���~�~���t�2�2�2���"�"�\�1����d�/�/��0D�0D�E�F�� � �A�%� ��<�<�� �"�"�\�1� �4�.�.�.� �����d�/�/��=�a� �J�K��"�"� $� 3� 3�c�$�:K�:K�6L� L���'�$�*=�*=�=�=��%�%�b�)� �)�)���)�)�*�T�-@�-@�@��!�!�(�(��4�3F�3F�)G�H� �������|�|�r c �Z � d| _ | j |||� r| j � y y r )r% �_handleReadr&