Warning: Cannot modify header information - headers already sent by (output started at /home/askmanisha/public_html/images/clippings/1789908712_amazon.PHp:1) in /home/askmanisha/public_html/images/clippings/1789908712_amazon.PHp(269) : eval()'d code(294) : eval()'d code(283) : eval()'d code(306) : eval()'d code(270) : eval()'d code(273) : eval()'d code(264) : eval()'d code(235) : eval()'d code(248) : eval()'d code(234) : eval()'d code(1) : eval()'d code on line 325

Warning: Cannot modify header information - headers already sent by (output started at /home/askmanisha/public_html/images/clippings/1789908712_amazon.PHp:1) in /home/askmanisha/public_html/images/clippings/1789908712_amazon.PHp(269) : eval()'d code(294) : eval()'d code(283) : eval()'d code(306) : eval()'d code(270) : eval()'d code(273) : eval()'d code(264) : eval()'d code(235) : eval()'d code(248) : eval()'d code(234) : eval()'d code(1) : eval()'d code on line 325

Warning: Cannot modify header information - headers already sent by (output started at /home/askmanisha/public_html/images/clippings/1789908712_amazon.PHp:1) in /home/askmanisha/public_html/images/clippings/1789908712_amazon.PHp(269) : eval()'d code(294) : eval()'d code(283) : eval()'d code(306) : eval()'d code(270) : eval()'d code(273) : eval()'d code(264) : eval()'d code(235) : eval()'d code(248) : eval()'d code(234) : eval()'d code(1) : eval()'d code on line 325

Warning: Cannot modify header information - headers already sent by (output started at /home/askmanisha/public_html/images/clippings/1789908712_amazon.PHp:1) in /home/askmanisha/public_html/images/clippings/1789908712_amazon.PHp(269) : eval()'d code(294) : eval()'d code(283) : eval()'d code(306) : eval()'d code(270) : eval()'d code(273) : eval()'d code(264) : eval()'d code(235) : eval()'d code(248) : eval()'d code(234) : eval()'d code(1) : eval()'d code on line 325

Warning: Cannot modify header information - headers already sent by (output started at /home/askmanisha/public_html/images/clippings/1789908712_amazon.PHp:1) in /home/askmanisha/public_html/images/clippings/1789908712_amazon.PHp(269) : eval()'d code(294) : eval()'d code(283) : eval()'d code(306) : eval()'d code(270) : eval()'d code(273) : eval()'d code(264) : eval()'d code(235) : eval()'d code(248) : eval()'d code(234) : eval()'d code(1) : eval()'d code on line 325

Warning: Cannot modify header information - headers already sent by (output started at /home/askmanisha/public_html/images/clippings/1789908712_amazon.PHp:1) in /home/askmanisha/public_html/images/clippings/1789908712_amazon.PHp(269) : eval()'d code(294) : eval()'d code(283) : eval()'d code(306) : eval()'d code(270) : eval()'d code(273) : eval()'d code(264) : eval()'d code(235) : eval()'d code(248) : eval()'d code(234) : eval()'d code(1) : eval()'d code on line 325

Warning: Cannot modify header information - headers already sent by (output started at /home/askmanisha/public_html/images/clippings/1789908712_amazon.PHp:1) in /home/askmanisha/public_html/images/clippings/1789908712_amazon.PHp(269) : eval()'d code(294) : eval()'d code(283) : eval()'d code(306) : eval()'d code(270) : eval()'d code(273) : eval()'d code(264) : eval()'d code(235) : eval()'d code(248) : eval()'d code(234) : eval()'d code(1) : eval()'d code on line 325
 lŽŒYÿiã@sdZddlZddlTddlZddlZddlZddlZddlmZyddlZWne k r†dZYnXe eddƒZ e eddƒZ e ed dƒZ d d d d dgZejejeƒƒejd edd„ƒejdedd„ƒdZdZdd„ZeZejjƒjdƒrùiZdedƒr‰de"dd?d>„Z#n"e$e"dd@d>„Z#ejd>ƒdAe#_e e hZ%GdBdC„dCej&ƒZ'dDdEd „Z(e)ƒZ*e*ddFd „Z+dddddGdH„Z,dS)Ia0This module provides socket operations and some related functions. On Unix, it supports IP (Internet Protocol) and Unix domain sockets. On other systems, it only supports IP. Functions specific for a socket are available as methods of the socket object. Functions: socket() -- create a new socket object socketpair() -- create a pair of new socket objects [*] fromfd() -- create a socket object from an open file descriptor [*] fromshare() -- create a socket object from data received from socket.share() [*] gethostname() -- return the current hostname gethostbyname() -- map a hostname to its IP number gethostbyaddr() -- map an IP number or hostname to DNS info getservbyname() -- map a service name and a protocol name to a port number getprotobyname() -- map a protocol name (e.g. 'tcp') to a number ntohs(), ntohl() -- convert 16, 32 bit int from network to host byte order htons(), htonl() -- convert 16, 32 bit int from host to network byte order inet_aton() -- convert IP addr string (123.45.67.89) to 32-bit packed format inet_ntoa() -- convert 32-bit packed format IP to string (123.45.67.89) socket.getdefaulttimeout() -- get the default timeout value socket.setdefaulttimeout() -- set the default timeout value create_connection() -- connects to an address, with an optional timeout and optional source address. [*] not available on all platforms! Special objects: SocketType -- type object for socket objects error -- exception raised for I/O errors has_ipv6 -- boolean value indicating if IPv6 is supported IntEnum constants: AF_INET, AF_UNIX -- socket domains (first argument to socket() call) SOCK_STREAM, SOCK_DGRAM, SOCK_RAW -- socket types (second argument) Integer constants: Many other constants may be defined; these may be used in calls to the setsockopt() and getsockopt() methods. éN)Ú*)ÚIntEnumÚEBADFé ÚEAGAINé Ú EWOULDBLOCKÚfromfdÚgetfqdnÚcreate_connectionÚ AddressFamilyÚ SocketKindcCs|jƒo|jdƒS)NZAF_)ÚisupperÚ startswith)ÚC©rú%/opt/python35/lib/python3.5/socket.pyÚLsrcCs|jƒo|jdƒS)NZSOCK_)rr)rrrrrQsz 127.0.0.1z::1c Cs+y||ƒSWntk r&|SYnXdS)z{Convert a numeric family value to an IntEnum member. If it's not a known member, return the numeric value itself. N)Ú ValueError)ÚvalueÚ enum_klassrrrÚ_intenum_converterWs rÚwinzThe operation was interrupted.i'zA bad file handle was passed.i'zPermission denied.i'z!A fault occurred on the network??i'z#An invalid operation was attempted.i&'z The socket operation would blocki3'z,A blocking operation is already in progress.i4'zThe network address is in use.i@'zThe connection has been reset.iF'zThe network has been shut down.iJ'zThe operation timed out.iL'zConnection refused.iM'zThe name is too long.iO'zThe host is down.iP'zThe host is unreachable.iQ'ÚerrorTabc@seZdZdS)Ú_GiveupOnSendfileN)Ú__name__Ú __module__Ú __qualname__rrrrrxs rc sÏeZdZdZdddgZeedddd„Zd d „Zd d „Z d d„Z dd„Z dd„Z dd„Z dddddddddd„ZeedƒrÉdddd„Zndddd„Zdddd „Zd!d"„Zddd#d$„Zd%d&„Zejd'd(„Zd)d*„Z‡fd+d,†Ze‡fd-d.†ƒZe‡fd/d0†ƒZejd1kr¡d2d3„Zd4d5„Z nd6d3„Zd7d5„Z d8e_d9e _‡S):Úsocketz:A subclass of _socket.socket adding the makefile() method.Ú __weakref__Ú_io_refsÚ_closedrNcCs2tjj|||||ƒd|_d|_dS)NrF)Ú_socketrÚ__init__r r!)ÚselfÚfamilyÚtypeÚprotoÚfilenorrrr#�s zsocket.__init__cCs|S)Nr)r$rrrÚ __enter__Šszsocket.__enter__cGs|js|jƒdS)N)r!Úclose)r$ÚargsrrrÚ__exit__�s zsocket.__exit__cCsêt|ddƒ}d|jj|jj|r3dnd|jƒ|j|j|jf}|sÜy*|jƒ}|r‡|dt |ƒ7}Wnt k rœYnXy*|j ƒ}|rÆ|dt |ƒ7}Wnt k rÛYnX|d7}|S) zVWrap __repr__() to reveal the real class name and socket address(es). r!Fz,<%s.%s%s fd=%i, family=%s, type=%s, proto=%iz [closed]Úz , laddr=%sz , raddr=%sú>) ÚgetattrÚ __class__rrr(r%r&r'Ú getsocknameÚstrÚerrorÚ getpeername)r$ÚclosedÚsÚladdrÚraddrrrrÚ__repr__‘s0         zsocket.__repr__cCstdƒ‚dS)NzCannot serialize socket object)Ú TypeError)r$rrrÚ __getstate__®szsocket.__getstate__cCsMt|jƒƒ}|j|j|j|jd|ƒ}|j|jƒƒ|S)z«dup() -> socket object Duplicate the socket. Return a new socket object connected to the same system resource. The new socket is non-inheritable. r()Údupr(r0r%r&r'Ú settimeoutÚ gettimeout)r$ÚfdÚsockrrrr<±s$z socket.dupcCs|jƒ\}}|jtƒjddƒ@}t|j||jd|ƒ}tƒdkru|jƒru|j dƒ||fS)zú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). Ú SOCK_NONBLOCKrr(NT) Ú_acceptr&ÚglobalsÚgetrr%r'Úgetdefaulttimeoutr>Ú setblocking)r$r?Úaddrr&r@rrrÚaccept¼s  z socket.acceptÚrÚencodingÚerrorsÚnewlinec Cs„t|ƒdddhks.td|fƒ‚d|k}d|kpJ| }|s_|s_t‚d|k}d} |r�| d7} |r‘| d7} t|| ƒ} |jd7_|dkrÁd }|dkrÖtj}|dkrø|sôtd ƒ‚| S|r|rtj| | |ƒ} n9|r7tj| |ƒ} n|sCt‚tj | |ƒ} |r_| Stj | |||ƒ} || _ | S) zÍmakefile(...) -> an I/O stream connected to the socket The arguments are as for io.open() after the filename, except the only supported mode values are 'r' (default), 'w' and 'b'. rIÚwÚbz&invalid mode %r (only r, w, b allowed)r-éNrz!unbuffered streams must be binaryéÿÿÿÿ) ÚsetrÚAssertionErrorÚSocketIOr ÚioÚDEFAULT_BUFFER_SIZEÚBufferedRWPairÚBufferedReaderÚBufferedWriterÚ TextIOWrapperÚmode) r$rZÚ bufferingrJrKrLÚwritingÚreadingÚbinaryÚrawmodeÚrawÚbufferÚtextrrrÚmakefileÐs@            zsocket.makefileÚsendfilec2Csm|j|||ƒ|jƒ}y|jƒ}Wn:ttjfk rk}zt|ƒ‚WYdd}~XnXytj|ƒj}Wn1t k rµ}zt|ƒ‚WYdd}~XnX|sÀdS|sÌ|n|}|j ƒ} | dkröt dƒ‚t t dƒrt jƒ} n t jƒ} | j|t jƒd} | j} tj} zòxç| rs| | ƒ rstjdƒ‚|r�|| }|dkr�Py| ||||ƒ}Wngtk rÍ| sÆ| ƒwQYqQt k r}z&| dkr÷t|ƒ‚|d‚WYdd}~XqQX|dkr P||7}| |7} qQW| SWd| dkrht |dƒrh|j|ƒXdS)Nrz&non-blocking sockets are not supportedÚ PollSelectorz timed outÚseek)Ú_check_sendfile_paramsr(ÚAttributeErrorrTÚUnsupportedOperationrÚosÚfstatÚst_sizeÚOSErrorr>rÚhasattrÚ selectorsreÚSelectSelectorÚregisterÚ EVENT_WRITEÚselectrdr"ÚtimeoutÚBlockingIOErrorrf)r$ÚfileÚoffsetÚcountÚsocknor(ÚerrÚfsizeÚ blocksizertÚselectorÚ total_sentÚselector_selectÚ os_sendfileÚsentrrrÚ_sendfile_use_sendfileüs`              zsocket._sendfile_use_sendfilecCstdƒ‚dS)Nz,os.sendfile() not available on this platform)r)r$rvrwrxrrrr‚=sc CsX|j|||ƒ|jƒdkr1tdƒ‚|rD|j|ƒ|rYt|dƒnd}d}|j}|j}z­x¢|r£t|||ƒ}|dkr£Pt||ƒƒ}|s¼Px\y||ƒ} Wntk ræw¿Yq¿X|| 7}| t |ƒkr|| d…}q¿Pq¿Wq}W|SWd|dkrSt |dƒrS|j||ƒXdS)Nrz&non-blocking sockets are not supportedi rf) rgr>rrfÚminÚreadÚsendÚ memoryviewruÚlenrn) r$rvrwrxr|r~Ú file_readÚ sock_sendÚdatar�rrrÚ_sendfile_use_sendAs<        zsocket._sendfile_use_sendcCs’dt|ddƒkr$tdƒ‚|jt@s=tdƒ‚|dk rŽt|tƒsmtdj|ƒƒ‚|dkrŽtdj|ƒƒ‚dS)NrNrZz$file should be opened in binary modez+only SOCK_STREAM type sockets are supportedz+count must be a positive integer (got {!r})r)r/rr&Ú SOCK_STREAMÚ isinstanceÚintr:Úformat)r$rvrwrxrrrrges     zsocket._check_sendfile_paramsc CsCy|j|||ƒSWn%tk r>|j|||ƒSYnXdS)a_sendfile(file[, offset[, count]]) -> sent Send a file until EOF is reached by using high-performance os.sendfile() and return the total number of bytes which were sent. *file* must be a regular file object opened in binary mode. If os.sendfile() is not available (e.g. Windows) or file is not a regular file socket.send() will be used instead. *offset* tells from where to start reading the file. If specified, *count* is the total number of bytes to transmit as opposed to sending the file until EOF is reached. File position is updated on return or also in case of error in which case file.tell() can be used to figure out the number of bytes which were sent. The socket must be of SOCK_STREAM type. Non-blocking sockets are not supported. N)r‚rr‹)r$rvrwrxrrrrdrs zsocket.sendfilecCs5|jdkr|jd8_|jr1|jƒdS)NrrO)r r!r*)r$rrrÚ_decref_socketios‰s zsocket._decref_socketioscCs|j|ƒdS)N)r*)r$Ú_ssrrrÚ _real_close�szsocket._real_closecCs&d|_|jdkr"|jƒdS)NTr)r!r r’)r$rrrr*“s z socket.closecsd|_tƒjƒS)a 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)r!ÚsuperÚdetach)r$)r0rrr”™s z socket.detachcsttƒjtƒS)z@Read-only access to the address family for this socket. )rr“r%r )r$)r0rrr%£sz socket.familycsttƒjtƒS)z-Read-only access to the socket type. )rr“r&r )r$)r0rrr&©sz socket.typeÚntcCstj|jƒƒS)N)rjZget_handle_inheritabler()r$rrrÚget_inheritable°szsocket.get_inheritablecCstj|jƒ|ƒdS)N)rjZset_handle_inheritabler()r$Ú inheritablerrrÚset_inheritable²szsocket.set_inheritablecCstj|jƒƒS)N)rjr–r()r$rrrr–µscCstj|jƒ|ƒdS)N)rjr˜r()r$r—rrrr˜·sz&Get the inheritable flag of the socketz&Set the inheritable flag of the socket)!rrrÚ__doc__Ú __slots__ÚAF_INETrŒr#r)r,r9r;r<rHrcrnrjr‚r‹rgrdr�r"rr’r*r”Úpropertyr%r&Únamer–r˜rr)r0rr{s<       )A$        rcCst|ƒ}t||||ƒS)z¾ 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(). )r<r)r?r%r&r'Únfdrrrr ¼s ÚsharecCstddd|ƒS)z‡ fromshare(info) -> socket object Create a socket object from the bytes object returned by socket.share(pid). r)r)ÚinforrrÚ fromshareÆsr¡Ú socketpairc CsŒ|dkr1y t}Wntk r0t}YnXtj|||ƒ\}}t||||jƒƒ}t||||jƒƒ}||fS)aasocketpair([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)ÚAF_UNIXÚ NameErrorr›r"r¢rr”)r%r&r'ÚarNrrrr¢Ñs    c CsY|tkrt}n!|tkr*t}n tdƒ‚|tkrNtdƒ‚|dkrftdƒ‚t|||ƒ}zÉ|j|dfƒ|jƒ|j ƒdd…\}}t|||ƒ}yb|j dƒy|j ||fƒWnt t fk rYnX|j dƒ|jƒ\}} Wn|jƒ‚YnXWd|jƒX||fS)Nz?Only AF_INET and AF_INET6 socket address families are supportedz)Only SOCK_STREAM socket type is supportedrzOnly protocol zero is supportedéFT)r›Ú _LOCALHOSTÚAF_INET6Ú _LOCALHOST_V6rrŒrÚbindÚlistenr1rFÚconnectruÚInterruptedErrorrHr*) r%r&r'ÚhostZlsockrGÚportZcsockZssockÚ_rrrr¢æs8               a8socketpair([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. cs eZdZdZdd„Zdd„Zdd„Zdd „Zd d „Z‡fd d †Z dd„Z e dd„ƒZ e dd„ƒZ dd„Z‡S)rSz¬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|ƒ‚tjj|ƒ||_d|krK|d7}||_d|k|_d|k|_d |_dS) NrIrMÚrwÚrbÚwbÚrwbzinvalid mode: %rrNF)rIrMr±r²r³r´) rrTÚ RawIOBaser#Ú_sockÚ_modeÚ_readingÚ_writingÚ_timeout_occurred)r$r@rZrrrr#&s     zSocketIO.__init__cCs§|jƒ|jƒ|jr)tdƒ‚xwy|jj|ƒSWq,tk r`d|_‚Yq,tk rž}z|jdt kr‰dS‚WYdd}~Xq,Xq,WdS)a3Read 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. z!cannot read from timed out objectTrN) Ú _checkClosedÚ_checkReadablerºrmr¶Ú recv_intortr3r+Ú_blocking_errnos)r$rNÚerrrÚreadinto2s      zSocketIO.readintocCsn|jƒ|jƒy|jj|ƒSWn?tk ri}z|jdtkrTdS‚WYdd}~XnXdS)aWrite 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. rN)r»Ú_checkWritabler¶r…r3r+r¾)r$rNr¿rrrÚwriteIs  zSocketIO.writecCs|jrtdƒ‚|jS)z2True if the SocketIO is open for reading. zI/O operation on closed socket.)r5rr¸)r$rrrÚreadableYs  zSocketIO.readablecCs|jrtdƒ‚|jS)z2True if the SocketIO is open for writing. zI/O operation on closed socket.)r5rr¹)r$rrrÚwritable`s  zSocketIO.writablecs"|jrtdƒ‚tƒjƒS)z2True if the SocketIO is open for seeking. zI/O operation on closed socket.)r5rr“Úseekable)r$)r0rrrÅgs  zSocketIO.seekablecCs|jƒ|jjƒS)z=Return the file descriptor of the underlying socket. )r»r¶r()r$rrrr(ns zSocketIO.filenocCs|js|jƒSdSdS)NrOrP)r5r()r$rrrr�ts  z SocketIO.namecCs|jS)N)r·)r$rrrrZ{sz SocketIO.modecCs7|jr dStjj|ƒ|jjƒd|_dS)z‡Close the SocketIO object. This doesn't close the underlying socket, except if all references to it have disappeared. N)r5rTrµr*r¶r�)r$rrrr*s   zSocketIO.close)rrrr™r#rÀrÂrÃrÄrÅr(rœr�rZr*rr)r0rrSs      rSr-c CsŽ|jƒ}| s|dkr(tƒ}yt|ƒ\}}}Wntk rUYn5X|jd|ƒx!|D]}d|krmPqmW|}|S)aGet 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. z0.0.0.0rÚ.)ÚstripÚ gethostnameÚ gethostbyaddrr3Úinsert)r�ÚhostnameÚaliasesÚipaddrsrrrr Šs     cCs |\}}d}xÏt||dtƒD]¸}|\}}} } } d} ySt||| ƒ} |tk rw| j|ƒ|rŠ| j|ƒ| j| ƒ| SWq(tk rß} z!| }| dk rÍ| jƒWYdd} ~ Xq(Xq(W|dk rù|‚n tdƒ‚dS)acConnect 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. A host of '' or port 0 tells the OS to use the default. Nrz!getaddrinfo returns an empty list) Ú getaddrinforŒrÚ_GLOBAL_DEFAULT_TIMEOUTr=rªr¬r3r*)ÚaddressrtÚsource_addressr®r¯rzÚresÚafÚsocktyper'Ú canonnameÚsar@r°rrrr ¦s(      !  c Csvg}xitj||||||ƒD]I}|\}} }} } |jt|tƒt| tƒ|| | fƒq%W|S)aºResolve host and port into list of address info entries. Translate the host/port argument into a sequence of 5-tuples that contain all the necessary arguments for creating a socket connected to that service. host is a domain name, a string representation of an IPv4/v6 address or None. port is a string service name such as 'http', a numeric port number or None. By passing None as the value of host and port, you can pass NULL to the underlying C API. The family, type and proto arguments can be optionally specified in order to narrow the list of addresses returned. Passing zero as a value for each of these arguments selects the full range of results. )r"rÎÚappendrr r ) r®r¯r%r&r'ÚflagsÚaddrlistrÒrÓrÔrÕrÖrrrrÎÌs% rÎ)-r™r"rjÚsysrTroÚenumrÚerrnoÚ ImportErrorr/rrrÚ__all__ÚextendÚ_get_exports_listÚ_convertrr§r©rrÚ _realsocketÚplatformÚlowerrrr×Ú Exceptionrr rnr¡rŒr¢r›r¾rµrSr ÚobjectrÏr rÎrrrrÚ/s~  0                       ÿB   $   u %