Your IP : 18.119.166.34
3
U��Z{ � @ s� d dl Z d dlZd dlZG dd� d�Zdd� Zedkr�d dlZejejej�Z e j
d
� e j� Zee�Z
ejejej�Zej
d� ej� Ze
jegg g de� e
j� Zeee�� dS )� Nc @ s6 e Zd Zdd� Zdd� Zd
dd�Zdd � Zd
d� ZdS )�NonBlockingFilec C s@ || _ tj| j j� tjtj� g | _g | _g | _d | _ d | _
d S )N)�fd�fcntl�fileno�F_SETFL�os�O_NDELAY�read_fd_set�write_fd_set�
exc_fd_set� user_data�callback)�selfr � r �!/usr/lib/python3.6/nonblocking.py�__init__
s zNonBlockingFile.__init__c C sH || _ x$| j D ]}tj|j� tjtj� qW || _|| _|| _|| _ d S )N)
r r r r r r r
r r r
)r r r
r r r
�fr r r �set_callback s zNonBlockingFile.set_callbackr c C s� x�d}| j | jg }| j}| j}td|� tj|||�\}}}td|||� | j|krfd}|j| j� | jr�|sx|sx|r�| j|||| j� |rP qW td� | jj |�S )Nr zCalling selectzSelect returned� Z Returning)
r r r
r �print�select�remover
r �read)r ZamtZstatus_changedZreadfdsZwritefdsZexcfdsr r r r ! s"