HEX
Server: Apache
System: Linux server2.voipitup.com.au 4.18.0-553.104.1.lve.el8.x86_64 #1 SMP Tue Feb 10 20:07:30 UTC 2026 x86_64
User: posscale (1027)
PHP: 8.2.29
Disabled: exec,passthru,shell_exec,system
Upload Files
File: //lib64/python3.6/site-packages/zmq/sugar/__pycache__/poll.cpython-36.opt-1.pyc
3

VS�_��@sRdZddlZddlmZddlmZmZmZGdd�de�Z	d
dd	�Z
dd	gZdS)z*0MQ polling related functions and classes.�N)�zmq_poll�)�POLLIN�POLLOUT�POLLERRc@sZeZdZdZdZiZdd�Zdd�Zee	Bfdd�Z
ee	Bfd	d
�Zdd�Zdd
d�Z
dS)�Pollerz>A stateful poll interface that mirrors Python's built-in poll.NcCsg|_i|_dS)N)�sockets�_map)�self�r�/usr/lib64/python3.6/poll.py�__init__szPoller.__init__cCs
||jkS)N)r	)r
�socketrrr�__contains__szPoller.__contains__cCsh|rN||jkr(|j|}||f|j|<qdt|j�}|jj||f�||j|<n||jkrd|j|�ndS)ap.register(socket, flags=POLLIN|POLLOUT)

        Register a 0MQ socket or native fd for I/O monitoring.
        
        register(s,0) is equivalent to unregister(s).

        Parameters
        ----------
        socket : zmq.Socket or native socket
            A zmq.Socket or any Python object having a ``fileno()`` 
            method that returns a valid file descriptor.
        flags : int
            The events to watch for.  Can be POLLIN, POLLOUT or POLLIN|POLLOUT.
            If `flags=0`, socket will be unregistered.
        N)r	r�len�append�
unregister)r
r�flags�idxrrr�registers



zPoller.registercCs|j||�dS)zCModify the flags for an already registered 0MQ socket or native fd.N)r)r
rrrrr�modify;sz
Poller.modifycCsJ|jj|�}|jj|�x,|j|d�D]\}}|j|d8<q(WdS)z�Remove a 0MQ socket or native fd for I/O monitoring.

        Parameters
        ----------
        socket : Socket
            The socket instance to stop polling.
        Nr)r	�popr)r
rrrrrrr?szPoller.unregistercCs6|dks|dkrd}nt|t�r(t|�}t|j|d�S)a�Poll the registered 0MQ or native fds for I/O.
        
        If there are currently events ready to be processed, this function will return immediately.
        Otherwise, this function will return as soon the first event is available or after timeout 
        milliseconds have elapsed.

        Parameters
        ----------
        timeout : float, int
            The timeout in milliseconds. If None, no `timeout` (infinite). This
            is in milliseconds to be compatible with ``select.poll()``.

        Returns
        -------
        events : list of tuples
            The list of events that are ready to be processed.
            This is a list of tuples of the form ``(socket, event_mask)``, where the 0MQ Socket
            or integer fd is the first element, and the poll event mask (POLLIN, POLLOUT) is the second.
            It is common to call ``events = dict(poller.poll())``,
            which turns the list of tuples into a mapping of ``socket : event_mask``.
        Nrr)�timeout���)�
isinstance�float�intrr)r
rrrr�pollMs

zPoller.poll)N)�__name__�
__module__�__qualname__�__doc__rr	r
rrrrrrrrrrrrsrcCs�|dkrd}t|d�}|dkr$d}g}xZt|||�D]F}d}||krR|tO}||krb|tO}||krr|tO}|j||f�q:Wt||�}ggg}}}xF|D]>\}}|t@r�|j|�|t@r�|j|�|t@r�|j|�q�W|||fS)a\select(rlist, wlist, xlist, timeout=None) -> (rlist, wlist, xlist)

    Return the result of poll as a lists of sockets ready for r/w/exception.

    This has the same interface as Python's built-in ``select.select()`` function.

    Parameters
    ----------
    timeout : float, int, optional
        The timeout in seconds. If None, no timeout (infinite). This is in seconds to be
        compatible with ``select.select()``.
    rlist : list of sockets/FDs
        sockets/FDs to be polled for read events
    wlist : list of sockets/FDs
        sockets/FDs to be polled for write events
    xlist : list of sockets/FDs
        sockets/FDs to be polled for error events
    
    Returns
    -------
    (rlist, wlist, xlist) : tuple of lists of sockets (length 3)
        Lists correspond to sockets available for read/write/error events respectively.
    Nrg@�@rrr)r�setrrrrr)ZrlistZwlistZxlistrr�srZreturn_socketsrrr�selectjs2


r$)N)r!ZzmqZzmq.backendrZ	constantsrrr�objectrr$�__all__rrrr�<module>sZ
8