%PDF- %PDF-
Direktori : /lib/python3/dist-packages/paramiko/__pycache__/ |
Current File : //lib/python3/dist-packages/paramiko/__pycache__/pipe.cpython-312.pyc |
� �ecV � �n � d Z ddlZddlZddlZd� Z G d� de� Z G d� de� Z G d� d e� Zd � Z y)a Abstraction of a one-way pipe where the read end can be used in `select.select`. Normally this is trivial, but Windows makes it nearly impossible. The pipe acts like an Event, which can be set or cleared. When set, the pipe will trigger as readable in `select <select.select>`. � Nc �^ � t j d d dk7 rt � } | S t � } | S )N� �win)�sys�platform� PosixPipe�WindowsPipe)�ps �//usr/lib/python3/dist-packages/paramiko/pipe.py� make_piper ! s1 � � �|�|�B�Q��5� ��K�� �H� �M���H� c �0 � e Zd Zd� Zd� Zd� Zd� Zd� Zd� Zy)r c �p � t j � \ | _ | _ d| _ d| _ d| _ y �NF)�os�pipe�_rfd�_wfd�_set�_forever�_closed��selfs r �__init__zPosixPipe.__init__* s+ � �!�w�w�y��� �4�9��� ��� ���r c � � t j | j � t j | j � d| _ y �NT)r �closer r r r s r r zPosixPipe.close0 s) � � ������� ���������r c � � | j S �N)r r s r �filenozPosixPipe.fileno6 s � ��y�y�r c � � | j r| j ry t j | j d� d| _ y �N� F)r r r �readr r s r �clearzPosixPipe.clear9 s+ � ��y�y�D�M�M�� ���� � �1���� r c � � | j s| j ry d| _ t j | j d� y �NT� *)r r r �writer r s r �setz PosixPipe.set? s+ � ��9�9������� � ������D�!r c �2 � d| _ | j � y r �r r* r s r �set_foreverzPosixPipe.set_foreverE � � ��� ���� r N) �__name__� __module__�__qualname__r r r r% r* r- � r r r r ) s � �����"�r r c �4 � e Zd ZdZd� Zd� Zd� Zd� Zd� Zd� Z y) r z� On Windows, only an OS-level "WinSock" may be used in select(), but reads and writes must be to the actual socket object. c �� � t j t j t j � }|j d� |j d� t j t j t j � | _ | j j d|j � d f� |j � \ | _ }|j � d| _ d| _ d| _ y )N)� 127.0.0.1r r# r5 F)�socket�AF_INET�SOCK_STREAM�bind�listen�_rsock�connect�getsockname�accept�_wsockr r r r )r �serv�addrs r r zWindowsPipe.__init__P s� � ��}�}�V�^�^�V�-?�-?�@��� � �"�#����A�� �m�m�F�N�N�F�4F�4F�G��������[�$�*:�*:�*<�Q�*?�@�A� �K�K�M����T�� � ���� ��� ���r c �z � | j j � | j j � d| _ y r )r; r r? r r s r r zWindowsPipe.close_ s) � ���������������r c �6 � | j j � S r )r; r r s r r zWindowsPipe.filenoe s � ��{�{�!�!�#�#r c �z � | j r| j ry | j j d� d| _ y r"