| Server IP : 61.19.30.66 / Your IP : 216.73.216.15 Web Server : Apache/2.2.22 (Ubuntu) System : Linux klw 3.11.0-15-generic #25~precise1-Ubuntu SMP Thu Jan 30 17:39:31 UTC 2014 x86_64 User : www-data ( 33) PHP Version : 5.3.10-1ubuntu3.48 Disable Function : pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority, MySQL : ON | cURL : OFF | WGET : ON | Perl : ON | Python : ON | Sudo : ON | Pkexec : OFF Directory : /usr/lib/python2.7/dist-packages/twisted/internet/ |
Upload File : |
Mc @ s d Z d d l Z d d l m Z d d l m Z d d l m Z m Z d d l m
Z
d e
j e
j f d YZ
d Z d d
g Z d S( s
An epoll() based implementation of the twisted main loop.
To install the event loop (and you should do this before any connections,
listeners or connectors are added)::
from twisted.internet import epollreactor
epollreactor.install()
iN( t
implements( t
IReactorFDSet( t logt _epoll( t posixbaset EPollReactorc B s e Z d Z e e e j e j BZ e j Z
e j Z d Z
d Z d Z d Z d Z d Z d Z d Z d Z d
Z d Z e Z RS( sX
A reactor that uses epoll(4).
@ivar _poller: A L{poll} which will be used to check for I/O
readiness.
@ivar _selectables: A dictionary mapping integer file descriptors to
instances of L{FileDescriptor} which have been registered with the
reactor. All L{FileDescriptors} which are currently receiving read or
write readiness notifications will be present as values in this
dictionary.
@ivar _reads: A dictionary mapping integer file descriptors to arbitrary
values (this is essentially a set). Keys in this dictionary will be
registered with C{_poller} for read readiness notifications which will
be dispatched to the corresponding L{FileDescriptor} instances in
C{_selectables}.
@ivar _writes: A dictionary mapping integer file descriptors to arbitrary
values (this is essentially a set). Keys in this dictionary will be
registered with C{_poller} for write readiness notifications which will
be dispatched to the corresponding L{FileDescriptor} instances in
C{_selectables}.
c C sA t j d | _ i | _ i | _ i | _ t j j | d S( sm
Initialize epoll object, file descriptor tracking dictionaries, and the
base class.
i N( R t epollt _pollert _readst _writest _selectablesR t PosixReactorBaset __init__( t self( ( sA /usr/lib/python2.7/dist-packages/twisted/internet/epollreactor.pyR 8 s
c
C sz | j } | | k rv t j } | } | | k rI | | O} t j } n | j j | | | d | | <| | | <n d S( s
Private method for adding a descriptor from the event loop.
It takes care of adding it if new or modifying it if already added
for another state (read -> read/write for example).
i N( t filenoR t CTL_ADDt CTL_MODR t _control(
R
t xert primaryt othert selectablest eventt antieventt fdt cmdt flags( ( sA /usr/lib/python2.7/dist-packages/twisted/internet/epollreactor.pyt _addF s
c C s/ | j | | j | j | j t j t j d S( sR
Add a FileDescriptor for notification of data available to read.
N( R R R R
R t INt OUT( R
t reader( ( sA /usr/lib/python2.7/dist-packages/twisted/internet/epollreactor.pyt addReadera s c C s/ | j | | j | j | j t j t j d S( sS
Add a FileDescriptor for notification of data available to write.
N( R R R R
R R R ( R
t writer( ( sA /usr/lib/python2.7/dist-packages/twisted/internet/epollreactor.pyt addWriterh s c C s | j } | d k rL x1 | j D] \ } } | | k r% Pq% q% Wd Sn | | k r t j } | }
| | k r | }
t j } n | | =| | =| j j | | |
n d S( s
Private method for removing a descriptor from the event loop.
It does the inverse job of _add, and also add a check in case of the fd
has gone away.
iN( R t itemsR t CTL_DELR R R ( R
R R R R R R R t fdesR R ( ( sA /usr/lib/python2.7/dist-packages/twisted/internet/epollreactor.pyt _removeo s c C s/ | j | | j | j | j t j t j d S( sQ
Remove a Selectable for notification of data available to read.
N( R% R R R
R R R ( R
R ( ( sA /usr/lib/python2.7/dist-packages/twisted/internet/epollreactor.pyt removeReader s c C s/ | j | | j | j | j t j t j d S( sR
Remove a Selectable for notification of data available to write.
N( R% R R R
R R R ( R
R ( ( sA /usr/lib/python2.7/dist-packages/twisted/internet/epollreactor.pyt removeWriter s c C sJ | j g | j D] } | j | ^ q g | j D] } | j | ^ q0 S( sD
Remove all selectables, and return a list of them.
( t
_removeAllR R
R ( R
R ( ( sA /usr/lib/python2.7/dist-packages/twisted/internet/epollreactor.pyt removeAll s c C s! g | j D] } | j | ^ q
S( N( R R
( R
R ( ( sA /usr/lib/python2.7/dist-packages/twisted/internet/epollreactor.pyt
getReaders s c C s! g | j D] } | j | ^ q
S( N( R R
( R
R ( ( sA /usr/lib/python2.7/dist-packages/twisted/internet/epollreactor.pyt
getWriters s c C s | d k r d } n t | d } y"