b374k
m1n1 1.01
Apache/2.2.15 (CentOS)
Linux obd60-6c49958d75-2q7cw 5.4.0-174-generic #193-Ubuntu SMP Thu Mar 7 14:29:28 UTC 2024 x86_64
uid=48(apache) gid=48(apache) groups=48(apache)
server ip : 172.67.192.52 | your ip : 10.244.126.0
safemode OFF
 >  / usr / lib64 / python2.6 /
Filename/usr/lib64/python2.6/socket.pyc
Size15.75 kb
Permissionrw-r--r--
Ownerapache
Create time23-Dec-2025 17:41
Last modified20-Jun-2019 19:45
Last accessed22-Apr-2026 05:24
Actionsedit | rename | delete | download (gzip)
Viewtext | code | image
Ñò
§ÚêLc!@sSdZddkZddkTyddkZWnej
onsXeed�ZddklZddklZl Z l
Z
l Z l Z l
Z
lZlZlZlZlZlZddkZddkZddkZyddklZWn#ej
oddklZnXyddkZWnej
o
eZnXeedd �Zeed
d �Zd d
gZeieie��e Z!ei"i#�i$d�o­hZ%de%d<de%d<de%d<de%d<de%d<de%d<de%d<de%d<de%d <d!e%d"<d#e%d$<d%e%d&<d'e%d(<d)e%d*<d+e%d,<ei&d-�nd.d/�Z'd0d1d2d3d4d5d6d7d8d9d:d;d<d=fZ(ei)d>joe(d?fZ(nei"d@joe(dAfZ(ndBdCdDdEdFdGfZ*dHe+fdI��YZ,dJe+fdK��YZ-e-Z Z.dL�Z/dMe+fdN��YZ0e+�Z1e1dO�Z2dS(PsÛThis 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 [*]
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)
ssl() -- secure socket layer support (only available if configured)
socket.getdefaulttimeout() -- get the default timeout value
socket.setdefaulttimeout() -- set the default timeout value
create_connection() -- connects to an address, with an optional timeout

[*] 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

Integer constants:

AF_INET, AF_UNIX -- socket domains (first argument to socket() call)
SOCK_STREAM, SOCK_DGRAM, SOCK_RAW -- socket types (second argument)

Many other constants may be defined; these may be used in calls to
the setsockopt() and getsockopt() methods.
iÿÿÿÿN(t*cCs5ddk}tidtdd�|i|||�S(Niÿÿÿÿs;socket.ssl() is deprecated. Use ssl.wrap_socket() instead.t
stackleveli(tssltwarningstwarntDeprecationWarningtsslwrap_simple(tsocktkeyfiletcertfilet_realssl((s/usr/lib64/python2.6/socket.pyR7s  
(tSSLError( tRAND_addtRAND_egdt RAND_statustSSL_ERROR_ZERO_RETURNtSSL_ERROR_WANT_READtSSL_ERROR_WANT_WRITEtSSL_ERROR_WANT_X509_LOOKUPtSSL_ERROR_SYSCALLt
SSL_ERROR_SSLtSSL_ERROR_WANT_CONNECTt
SSL_ERROR_EOFtSSL_ERROR_INVALID_ERROR_CODE(tStringIOtEBADFi tEINTRitgetfqdntcreate_connectiontwinsThe operation was interrupted.i'sA bad file handle was passed.i'sPermission denied.i's!A fault occurred on the network??i's#An invalid operation was attempted.i&'s The socket operation would blocki3's,A blocking operation is already in progress.i4'sThe network address is in use.i@'sThe connection has been reset.iF'sThe network has been shut down.iJ'sThe operation timed out.iL'sConnection refused.iM'sThe name is too long.iO'sThe host is down.iP'sThe host is unreachable.iQ'terrorTabtcCs�|i�}| p
|djo
t�}nyt|�\}}}Wntj
on;X|id|�x&|D]}d|joPqtqtW|}|S(sGet 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.
s0.0.0.0it.(tstript gethostnamet
gethostbyaddrterrortinsert(tnamethostnametaliasestipaddrs((s/usr/lib64/python2.6/socket.pyRys 

 tbindtconnectt
connect_extfilenotlistent getpeernamet getsocknamet
getsockoptt
setsockopttsendallt setblockingt
settimeoutt
gettimeouttshutdowntnttioctltriscost
sleeptaskwtrecvtrecvfromt recv_intot
recvfrom_intotsendtsendtot
_closedsocketcBs7eZgZd�ZeZZZZZZ eZ
RS(cGsttd��dS(NsBad file descriptor(R$R(targs((s/usr/lib64/python2.6/socket.pyt_dummy¦s( t__name__t
__module__t __slots__RDR@R<R>RAR=R?t __getattr__(((s/usr/lib64/python2.6/socket.pyRB¤s t
_socketobjectcBsøeZeiZddgee�Zeeddd�Z
d�Z ei ie _d�Z ei ie _d�Z
ddd �Zed
�d d �Zed
�d d�Zed�d d�ZdZx&eD]ZeeeeefdUqÎW[[RS(t_sockt __weakref__icCsZ|djot|||�}n||_x'tD]}t||t||��q3WdS(N(tNonet _realsocketRJt_delegate_methodstsetattrtgetattr(tselftfamilyttypetprotoRJtmethod((s/usr/lib64/python2.6/socket.pyt__init__¶s 
 cCs=t�|_|ii}xtD]}t|||�qWdS(N(RBRJRDRNRO(RQtdummyRU((s/usr/lib64/python2.6/socket.pytclose½s
  cCs(|ii�\}}td|�|fS(NRJ(RJtacceptRI(RQRtaddr((s/usr/lib64/python2.6/socket.pyRYÄscCstd|i�S(sadup() -> socket object

Return a new socket object connected to the same system resource.RJ(RIRJ(RQ((s/usr/lib64/python2.6/socket.pytdupÉstriÿÿÿÿcCst|i||�S(s¾makefile([mode[, bufsize]]) -> file object

Return a regular file object corresponding to the socket. The mode
and bufsize arguments are as for the built-in open() function.(t _fileobjectRJ(RQtmodetbufsize((s/usr/lib64/python2.6/socket.pytmakefileÏscCs
|iiS((RJRR(RQ((s/usr/lib64/python2.6/socket.pyt<lambda>Östdocsthe socket familycCs
|iiS((RJRS(RQ((s/usr/lib64/python2.6/socket.pyRa×ssthe socket typecCs
|iiS((RJRT(RQ((s/usr/lib64/python2.6/socket.pyRaØssthe socket protocolsVdef %s(self, *args): return self._sock.%s(*args)

%s.__doc__ = _realsocket.%s.__doc__
N(RERFRMt__doc__tlistRNRGtAF_INETt SOCK_STREAMRLRVRXRYR[R`tpropertyRRRSRTt_st_socketmethodst_m(((s/usr/lib64/python2.6/socket.pyRI°s"    cCs7t|i�djo|idtjodSndS(Nii(tlenRCR(texc((s/usr/lib64/python2.6/socket.pyt_exception_was_EINTRâs R]c
BsàeZdZdZdZddddddd d
d d g
Zd
ded�Zd�Ze edd�Z
d�Z d�Z d�Z
d�Zd�Zd�Zd�Zdd�Zdd�Zdd�Zd�Zd�ZRS( s-Faux file object attached to a socket object.i s<socket>R^R_t softspaceRJt _rbufsizet _wbufsizet_rbuft_wbuft _wbuf_lent_closetrbiÿÿÿÿcCs²||_||_|djo
|i}n||_t|_|djo
d|_n'|djo|i|_n
||_||_t�|_ g|_
d|_ ||_ dS(Nii(
RJR^tdefault_bufsizeR_tFalseRnRoRpRRqRrRsRt(RQRR^R_RX((s/usr/lib64/python2.6/socket.pyRVós   

  


     cCs
|idjS(N(RJRL(RQ((s/usr/lib64/python2.6/socket.pyt
_getclosed
sRbsTrue if the file is closedcCsHz|io|i�nWd|io|ii�nd|_XdS(N(RJtflushRtRXRL(RQ((s/usr/lib64/python2.6/socket.pyRXs 

cCsy|i�WnnXdS(N(RX(RQ((s/usr/lib64/python2.6/socket.pyt__del__sc Cs|iodi|i�}g|_d|_t|i|i�}t|�}d}z~xw||joiti�i i
�zAt i oti
ddt�n|iit|||��WdQX||7}q[WWd||jo0||}~|ii|�t|�|_nXndS(NRitignores.*buffer(RrtjoinRstmaxRoRvRkRtcatch_warningst__exit__t __enter__tsyst py3kwarningtfilterwarningsRRJR3tbuffertappend(RQtdatat buffer_sizet data_sizet write_offsett remainder((s/usr/lib64/python2.6/socket.pyRy!s*
   

  "

cCs
|ii�S(N(RJR-(RQ((s/usr/lib64/python2.6/socket.pyR-8scCs�t|�}|pdS|ii|�|it|�7_|idjp0|idjo
d|jp|i|ijo|i�ndS(Niis
(tstrRrR�RsRkRpRy(RQR�((s/usr/lib64/python2.6/socket.pytwrite;s cCs{tdtt|��}|ittt|��7_|ii|�|i djp|i|i jo|i
�ndS(Ni( tfilterRLtmapR�RstsumRkRrtextendRpRy(RQRdtlines((s/usr/lib64/python2.6/socket.pyt
writelinesFs cCs|iS(N(Rs(RQ((s/usr/lib64/python2.6/socket.pyt
_get_wbuf_lenPsc
Cs"t|i|i�}|i}|idd�|djo�t�|_xjtoby|ii|�}Wn,t j
o }t
|�oqJn�nX|pPn|i |�qJW|i �S|i
�}||joC|id�|i|�}t�|_|ii |i��|St�|_xêtoâ||}y|ii|�}Wn,t j
o }t
|�oq*n�nX|pPnt|�} | |jo
| o|S| |jo|i |�~Pn| |jptd|| f�|i |�|| 7}~q*W|i �SdS(Niisrecv(%d) returned %d bytes(R}RoRvRqtseekRtTrueRJR<R$RmR�tgetvaluettelltreadRktAssertionError(
RQtsizetrbufsizetbufR�tetbuf_lentrvtlefttn((s/usr/lib64/python2.6/socket.pyR�Ss` 
 
  

  

 

!

c
Cs5|i}|idd�|i�djom|id�|i|�}|id�pt|�|jo't�|_|ii|i��|S~n|djo¿|i djoÅ|id�|i�g}t�|_d}|i i }xzt
ory>x7|djo)|d�}|pPn|i|�qWWn,tj
o }t|�oqón�nXPqóWdi|�S|idd�t�|_xÀt
o¸y|i i |i �}Wn,tj
o }t|�oq�n�nX|pPn|id�}|djo7|d7}|i|| �|ii||�~Pn|i|�q�W|i�S|idd�|i�} | |joC|id�|i|�}
t�|_|ii|i��|
St�|_xGt
o?y|i i |i �}Wn,tj
o }t|�oqàn�nX|pPn|| } |idd| �}|djoG|d7}|ii||�| o|i|| �Pq®|| Snt|�} | |jo
| o|S| | jo*|i|| �|ii|| �Pn|i|�| | 7} qàW|i�SdS(Niis
iR(RqR�R�treadlinetendswithRkRR�R�RoRLRJR<R�R�R$RmR|tfindR�(
RQR�R�tblinetbuffersR�R<R�tnlR�R�R R¡((s/usr/lib64/python2.6/socket.pyR¢�s¶ 
# 

  
 
 


  

  



  

icCsmd}g}xZtoR|i�}|pPn|i|�|t|�7}|o||joPqqW|S(Ni(R�R¢R�Rk(RQtsizehintttotalRdtline((s/usr/lib64/python2.6/socket.pyt readliness 

cCs|S(N((RQ((s/usr/lib64/python2.6/socket.pyt__iter__scCs!|i�}|p
t�n|S(N(R¢t
StopIteration(RQRª((s/usr/lib64/python2.6/socket.pytnexts 
(RERFRcRvR&RGRwRVRxRgtclosedRXRzRyR-R�R�R�R�R¢R«R¬R®(((s/usr/lib64/python2.6/socket.pyR]ès*      
 F i  c CsÒd}|\}}x°t||dt�D]�}|\}}}} }
d} yEt|||�} |tj o| i|�n| i|
�| SWq(tj
o$}| dj o| i�qÁq(Xq(Wt|�dS(s�Connect 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.
s!getaddrinfo returns an empty listiN( t getaddrinfoRfRLtsockett_GLOBAL_DEFAULT_TIMEOUTR5R+R$RX( taddressttimeouttmsgthosttporttrestaftsocktypeRTt canonnametsaR((s/usr/lib64/python2.6/socket.pyRs  


(3Rct_sockett_sslt ImportErrorRLRR tsslerrorR R
RRRRRRRRRRtosR�Rt cStringIORterrnoRPRRt__all__R�t_get_exports_listR±RMtplatformtlowert
startswithRR�RRiR&RNtobjectRBRIt
SocketTypeRmR]R²R(((s/usr/lib64/python2.6/socket.pyt<module>,sx 
 R$  














     0
 ÿ3