| 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 : |
ó
H!¯Nc @ sÈ d Z d d l Z d d l m Z m Z d d l m Z m Z m Z m Z m
Z
d d l m Z d d l
m Z d d l m Z d d l m Z d e j e j f d
„ ƒ YZ d „ Z d d g Z d S(
sñ
A poll() 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 pollreactor
pollreactor.install()
iÿÿÿÿN( t errort poll( t POLLINt POLLOUTt POLLHUPt POLLERRt POLLNVAL( t
implements( t log( t posixbase( t
IReactorFDSett PollReactorc B s› e Z d Z e e ƒ e e Be BZ e Z
e Z d „ Z
d „ Z d „ Z d „ Z d „ Z d „ Z d „ Z d „ Z d „ Z e Z d
„ Z d „ Z RS( sW
A reactor that uses poll(2).
@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 s; t ƒ | _ i | _ i | _ i | _ t j j | ƒ d S( so
Initialize polling object, file descriptor tracking dictionaries, and
the base class.
N( R t _pollert _selectablest _readst _writesR t PosixReactorBaset __init__( t self( ( s@ /usr/lib/python2.7/dist-packages/twisted/internet/pollreactor.pyR ; s
c C s¨ y | j j | ƒ Wn t k
r' n Xd } | | j k rJ | t B} n | | j k rf | t B} n | d k rˆ | j j | | ƒ n | | j k r¤ | j | =n d S( s* Register/unregister an fd with the poller.i N( R t
unregistert KeyErrorR R R R t registerR
( R t fdt mask( ( s@ /usr/lib/python2.7/dist-packages/twisted/internet/pollreactor.pyt _updateRegistrationG s
c C s} y | j ƒ } | | Wn; x5 | j j ƒ D] \ } } | | k r. Pq. q. Wd Sn X| | k ry | | =| j | ƒ n d S( N( t filenoR
t itemsR ( R t
selectablet mdictR t fdes( ( s@ /usr/lib/python2.7/dist-packages/twisted/internet/pollreactor.pyt _dictRemoveY s c C sI | j ƒ } | | j k rE | | j | <d | j | <| j | ƒ n d S( sI Add a FileDescriptor for notification of data available to read.
i N( R R R
R ( R t readerR ( ( s@ /usr/lib/python2.7/dist-packages/twisted/internet/pollreactor.pyt addReadern s
c C sI | j ƒ } | | j k rE | | j | <d | j | <| j | ƒ n d S( sJ Add a FileDescriptor for notification of data available to write.
i N( R R R
R ( R t writerR ( ( s@ /usr/lib/python2.7/dist-packages/twisted/internet/pollreactor.pyt addWriterw s
c C s | j | | j ƒ S( sH Remove a Selectable for notification of data available to read.
( R R ( R R ( ( s@ /usr/lib/python2.7/dist-packages/twisted/internet/pollreactor.pyt removeReader€ s c C s | j | | j ƒ S( sI Remove a Selectable for notification of data available to write.
( R R ( R R! ( ( s@ /usr/lib/python2.7/dist-packages/twisted/internet/pollreactor.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 ( ( s@ /usr/lib/python2.7/dist-packages/twisted/internet/pollreactor.pyt removeAllŠ s c C sÍ | d k r t | d ƒ } n y | j j | ƒ } Wn0 t k
rg } | j d t j k ra d S‚ n X| j } xU | D]M \ } } y | j | } Wn t
k
r« qx n Xt j | | | | | ƒ qx Wd S( s Poll the poller for new events.iè i N(
t Nonet intR R t SelectErrort argst errnot EINTRt _doReadOrWriteR
R R t callWithLogger( R t timeoutt lt et _drdwR t eventR ( ( s@ /usr/lib/python2.7/dist-packages/twisted/internet/pollreactor.pyt doPoll“ s
c C s! g | j D] } | j | ^ q
S( N( R R
( R R ( ( s@ /usr/lib/python2.7/dist-packages/twisted/internet/pollreactor.pyt
getReaders« s c C s! g | j D] } | j | ^ q
S( N( R R
( R R ( ( s@ /usr/lib/python2.7/dist-packages/twisted/internet/pollreactor.pyt
getWriters¯ s ( t __name__t
__module__t __doc__R R
R R R t _POLL_DISCONNECTEDR t _POLL_INR t _POLL_OUTR R R R R"