ž Ź˙fA:c @sPdZddlZddlTddlZddlZddlZyddlZWnek rjdZYnXeeddƒZ eeddƒZ eeddƒZ d d gZ e j ejeƒƒeZejjƒjd ƒriZd ed socket object Return a new socket object connected to the same system resource. ufileno(udupufilenou __class__ufamilyutypeuprotou settimeoutu gettimeout(uselfufdusock((u+/opt/alt/python33/lib64/python3.3/socket.pyudupvs$u socket.dupcCsh|jƒ\}}t|j|j|jd|ƒ}tƒdkr^|jƒr^|jdƒn||fS(uúaccept() -> (socket object, address info) Wait for an incoming connection. Return a new socket representing the connection, and the address of the client. For IP sockets, the address info is a pair (hostaddr, port). ufilenoNT( u_acceptusocketufamilyutypeuprotougetdefaulttimeoutuNoneu gettimeoutu setblockinguTrue(uselfufduaddrusock((u+/opt/alt/python33/lib64/python3.3/socket.pyuaccept€s !u socket.acceptuencodinguerrorsunewlineurcCs‘x)|D]!}|d krtdƒ‚qqWd|k}d|kpH| }|s]|s]t‚d|k} d} |r‚| d7} n|r•| d7} nt|| ƒ} |jd7_|d krČd }n|dkrŕtj}n|dkr| stdƒ‚n| S|r)|r)tj| | |ƒ} n9|rDtj| |ƒ} n|sPt‚tj | |ƒ} | rl| Stj | |||ƒ} || _ | S( u makefile(...) -> an I/O stream connected to the socket The arguments are as for io.open() after the filename, except the only mode characters supported are 'r', 'w' and 'b'. The semantics are similar too. (XXX refactor to share code?) uruwubu&invalid mode %r (only r, w, b allowed)uiiu!unbuffered streams must be binary>uwurubNi˙˙˙˙( u ValueErroruAssertionErroruSocketIOu_io_refsuNoneuiouDEFAULT_BUFFER_SIZEuBufferedRWPairuBufferedReaderuBufferedWriteru TextIOWrapperumode(uselfumodeu bufferinguencodinguerrorsunewlineucuwritingureadingubinaryurawmodeurawubufferutext((u+/opt/alt/python33/lib64/python3.3/socket.pyumakefilesB              usocket.makefilecCs;|jdkr!|jd8_n|jr7|jƒndS(Nii(u_io_refsu_closeduclose(uself((u+/opt/alt/python33/lib64/python3.3/socket.pyu_decref_socketiosťs usocket._decref_socketioscCs|j|ƒdS(N(uclose(uselfu_ss((u+/opt/alt/python33/lib64/python3.3/socket.pyu _real_closeÁsusocket._real_closecCs)d|_|jdkr%|jƒndS(NiT(uTrueu_closedu_io_refsu _real_close(uself((u+/opt/alt/python33/lib64/python3.3/socket.pyucloseĹs u socket.closecsd|_tƒjƒS(u detach() -> file descriptor Close the socket object without closing the underlying file descriptor. The object cannot be used after this call, but the file descriptor can be reused for other purposes. The file descriptor is returned. T(uTrueu_closedusuperudetach(uself(u __class__(u+/opt/alt/python33/lib64/python3.3/socket.pyudetachËs u socket.detachN(u__name__u __module__u __qualname__u__doc__u __slots__uAF_INETu SOCK_STREAMuNoneu__init__u __enter__u__exit__u__repr__u __getstate__udupuacceptumakefileu_decref_socketiosu_socketusocketu _real_closeucloseudetach(u __locals__((u __class__u+/opt/alt/python33/lib64/python3.3/socket.pyusocketWs    !*  usocketcCst|ƒ}t||||ƒS(už fromfd(fd, family, type[, proto]) -> socket object Create a socket object from a duplicate of the given file descriptor. The remaining arguments are the same as for socket(). (udupusocket(ufdufamilyutypeuprotounfd((u+/opt/alt/python33/lib64/python3.3/socket.pyufromfdŐs ufromfdusharecCstddd|ƒS(u‰ fromshare(info) -> socket object Create a socket object from a the bytes object returned by socket.share(pid). i(usocket(uinfo((u+/opt/alt/python33/lib64/python3.3/socket.pyu fromshareßsu fromshareu socketpairc Cs|dkr4y t}Wq4tk r0t}Yq4Xntj|||ƒ\}}t||||jƒƒ}t||||jƒƒ}||fS(uasocketpair([family[, type[, proto]]]) -> (socket object, socket object) Create a pair of socket objects from the sockets returned by the platform socketpair() function. The arguments are the same as for socket() except the default family is AF_UNIX if defined on the platform; otherwise, the default is AF_INET. N(uNoneuAF_UNIXu NameErroruAF_INETu_socketu socketpairusocketudetach(ufamilyutypeuprotouaub((u+/opt/alt/python33/lib64/python3.3/socket.pyu socketpairés   cs¤|EeZdZdZdd„Zdd„Zdd„Zdd „Zd d „Z‡fd d †Z dd„Z e dd„ƒZ e dd„ƒZ dd„Z‡S(uSocketIOuŹRaw I/O implementation for stream sockets. This class supports the makefile() method on sockets. It provides the raw I/O interface on top of a socket object. cCs…|d krtd|ƒ‚ntjj|ƒ||_d|krQ|d7}n||_d|k|_d|k|_d |_ dS( Nuruwurwurbuwburwbuinvalid mode: %rub(uruwurwurbuwburwbF( u ValueErroruiou RawIOBaseu__init__u_socku_modeu_readingu_writinguFalseu_timeout_occurred(uselfusockumode((u+/opt/alt/python33/lib64/python3.3/socket.pyu__init__s     uSocketIO.__init__cCs˝|jƒ|jƒ|jr,tdƒ‚nxŠy|jj|ƒSWq/tk rcd|_‚Yq/tk rww/Yq/t k rľ}z|j dt kr dS‚WYdd}~Xq/Xq/dS(u3Read up to len(b) bytes into the writable buffer *b* and return the number of bytes read. If the socket is non-blocking and no bytes are available, None is returned. If *b* is non-empty, a 0 return value indicates that the connection was shutdown at the other end. u!cannot read from timed out objectiNT( u _checkClosedu_checkReadableu_timeout_occurreduIOErroru_socku recv_intoutimeoutuTrueuInterruptedErroruerroruargsu_blocking_errnosuNone(uselfubue((u+/opt/alt/python33/lib64/python3.3/socket.pyureadintos       uSocketIO.readintocCsn|jƒ|jƒy|jj|ƒSWn?tk ri}z|jdtkrTdS‚WYdd}~XnXdS(uWrite the given bytes or bytearray object *b* to the socket and return the number of bytes written. This can be less than len(b) if not all data could be written. If the socket is non-blocking and no bytes could be written None is returned. iN(u _checkClosedu_checkWritableu_sockusenduerroruargsu_blocking_errnosuNone(uselfubue((u+/opt/alt/python33/lib64/python3.3/socket.pyuwrite4s  uSocketIO.writecCs|jrtdƒ‚n|jS(u2True if the SocketIO is open for reading. uI/O operation on closed socket.(uclosedu ValueErroru_reading(uself((u+/opt/alt/python33/lib64/python3.3/socket.pyureadableDs uSocketIO.readablecCs|jrtdƒ‚n|jS(u2True if the SocketIO is open for writing. uI/O operation on closed socket.(uclosedu ValueErroru_writing(uself((u+/opt/alt/python33/lib64/python3.3/socket.pyuwritableKs uSocketIO.writablecs%|jrtdƒ‚ntƒjƒS(u2True if the SocketIO is open for seeking. uI/O operation on closed socket.(uclosedu ValueErrorusuperuseekable(uself(u __class__(u+/opt/alt/python33/lib64/python3.3/socket.pyuseekableRs uSocketIO.seekablecCs|jƒ|jjƒS(u=Return the file descriptor of the underlying socket. (u _checkClosedu_sockufileno(uself((u+/opt/alt/python33/lib64/python3.3/socket.pyufilenoYs uSocketIO.filenocCs|js|jƒSdSdS(Nii˙˙˙˙(uclosedufileno(uself((u+/opt/alt/python33/lib64/python3.3/socket.pyuname_s  u SocketIO.namecCs|jS(N(u_mode(uself((u+/opt/alt/python33/lib64/python3.3/socket.pyumodefsu SocketIO.modecCs7|jr dStjj|ƒ|jjƒd|_dS(u‡Close the SocketIO object. This doesn't close the underlying socket, except if all references to it have disappeared. N(ucloseduiou RawIOBaseucloseu_socku_decref_socketiosuNone(uself((u+/opt/alt/python33/lib64/python3.3/socket.pyuclosejs   uSocketIO.close(u__name__u __module__u __qualname__u__doc__u__init__ureadintouwriteureadableuwritableuseekableufilenoupropertyunameumodeuclose(u __locals__((u __class__u+/opt/alt/python33/lib64/python3.3/socket.pyuSocketIOţs     uSocketIOuc Cs”|jƒ}| s|dkr+tƒ}nyt|ƒ\}}}Wntk rXYn8X|jd|ƒx$|D]}d|krpPqpqpW|}|S(uGet fully qualified domain name from name. An empty argument is interpreted as meaning the local host. First the hostname returned by gethostbyaddr() is checked, then possibly existing aliases. In case no FQDN is available, hostname from gethostname() is returned. u0.0.0.0iu.(ustripu gethostnameu gethostbyaddruerroruinsert(unameuhostnameualiasesuipaddrs((u+/opt/alt/python33/lib64/python3.3/socket.pyugetfqdnus     cCs|\}}d}xŘt||dtƒD]Á}|\}}} } } d} yYt||| ƒ} |tk rz| j|ƒn|r| j|ƒn| j| ƒ| SWq(tk rč} z$| }| dk rÖ| j ƒnWYdd} ~ Xq(Xq(W|dk r|‚n tdƒ‚dS(udConnect to *address* and return the socket object. Convenience function. Connect to *address* (a 2-tuple ``(host, port)``) and return the socket object. Passing the optional *timeout* parameter will set the timeout on the socket instance before attempting to connect. If no *timeout* is supplied, the global default timeout setting returned by :func:`getdefaulttimeout` is used. If *source_address* is set it must be a tuple of (host, port) for the socket to bind as a source address before making the connection. An host of '' or port 0 tells the OS to use the default. iNu!getaddrinfo returns an empty list( uNoneu getaddrinfou SOCK_STREAMusocketu_GLOBAL_DEFAULT_TIMEOUTu settimeoutubinduconnectuerroruclose(uaddressutimeoutusource_addressuhostuportuerruresuafusocktypeuprotou canonnameusausocku_((u+/opt/alt/python33/lib64/python3.3/socket.pyucreate_connection‘s(    $  ("u__doc__u_socketuosusysuiouerrnou ImportErroruNoneugetattruEBADFuEAGAINu EWOULDBLOCKu__all__uextendu_get_exports_listusocketu _realsocketuplatformuloweru startswithuerrorTabuappendufromfduhasattru fromshareu SOCK_STREAMu socketpairu_blocking_errnosu RawIOBaseuSocketIOugetfqdnuobjectu_GLOBAL_DEFAULT_TIMEOUTucreate_connection(((u+/opt/alt/python33/lib64/python3.3/socket.pyu-sV  $                  ~  w