Edit File by line
/home/barbar84/www/wp-conte.../plugins/sujqvwi/AnonR/smanonr..../lib64/python3..../multipro...
File: connection.py
#
[0] Fix | Delete
# A higher level module for using sockets (or Windows named pipes)
[1] Fix | Delete
#
[2] Fix | Delete
# multiprocessing/connection.py
[3] Fix | Delete
#
[4] Fix | Delete
# Copyright (c) 2006-2008, R Oudkerk
[5] Fix | Delete
# Licensed to PSF under a Contributor Agreement.
[6] Fix | Delete
#
[7] Fix | Delete
[8] Fix | Delete
__all__ = [ 'Client', 'Listener', 'Pipe', 'wait' ]
[9] Fix | Delete
[10] Fix | Delete
import io
[11] Fix | Delete
import os
[12] Fix | Delete
import sys
[13] Fix | Delete
import socket
[14] Fix | Delete
import struct
[15] Fix | Delete
import time
[16] Fix | Delete
import tempfile
[17] Fix | Delete
import itertools
[18] Fix | Delete
[19] Fix | Delete
import _multiprocessing
[20] Fix | Delete
[21] Fix | Delete
from . import util
[22] Fix | Delete
[23] Fix | Delete
from . import AuthenticationError, BufferTooShort
[24] Fix | Delete
from .context import reduction
[25] Fix | Delete
_ForkingPickler = reduction.ForkingPickler
[26] Fix | Delete
[27] Fix | Delete
try:
[28] Fix | Delete
import _winapi
[29] Fix | Delete
from _winapi import WAIT_OBJECT_0, WAIT_ABANDONED_0, WAIT_TIMEOUT, INFINITE
[30] Fix | Delete
except ImportError:
[31] Fix | Delete
if sys.platform == 'win32':
[32] Fix | Delete
raise
[33] Fix | Delete
_winapi = None
[34] Fix | Delete
[35] Fix | Delete
#
[36] Fix | Delete
#
[37] Fix | Delete
#
[38] Fix | Delete
[39] Fix | Delete
BUFSIZE = 8192
[40] Fix | Delete
# A very generous timeout when it comes to local connections...
[41] Fix | Delete
CONNECTION_TIMEOUT = 20.
[42] Fix | Delete
[43] Fix | Delete
# The hmac module implicitly defaults to using MD5.
[44] Fix | Delete
# Support using a stronger algorithm for the challenge/response code:
[45] Fix | Delete
HMAC_DIGEST_NAME='sha256'
[46] Fix | Delete
[47] Fix | Delete
_mmap_counter = itertools.count()
[48] Fix | Delete
[49] Fix | Delete
default_family = 'AF_INET'
[50] Fix | Delete
families = ['AF_INET']
[51] Fix | Delete
[52] Fix | Delete
if hasattr(socket, 'AF_UNIX'):
[53] Fix | Delete
default_family = 'AF_UNIX'
[54] Fix | Delete
families += ['AF_UNIX']
[55] Fix | Delete
[56] Fix | Delete
if sys.platform == 'win32':
[57] Fix | Delete
default_family = 'AF_PIPE'
[58] Fix | Delete
families += ['AF_PIPE']
[59] Fix | Delete
[60] Fix | Delete
[61] Fix | Delete
def _init_timeout(timeout=CONNECTION_TIMEOUT):
[62] Fix | Delete
return time.monotonic() + timeout
[63] Fix | Delete
[64] Fix | Delete
def _check_timeout(t):
[65] Fix | Delete
return time.monotonic() > t
[66] Fix | Delete
[67] Fix | Delete
#
[68] Fix | Delete
#
[69] Fix | Delete
#
[70] Fix | Delete
[71] Fix | Delete
def arbitrary_address(family):
[72] Fix | Delete
'''
[73] Fix | Delete
Return an arbitrary free address for the given family
[74] Fix | Delete
'''
[75] Fix | Delete
if family == 'AF_INET':
[76] Fix | Delete
return ('localhost', 0)
[77] Fix | Delete
elif family == 'AF_UNIX':
[78] Fix | Delete
return tempfile.mktemp(prefix='listener-', dir=util.get_temp_dir())
[79] Fix | Delete
elif family == 'AF_PIPE':
[80] Fix | Delete
return tempfile.mktemp(prefix=r'\\.\pipe\pyc-%d-%d-' %
[81] Fix | Delete
(os.getpid(), next(_mmap_counter)), dir="")
[82] Fix | Delete
else:
[83] Fix | Delete
raise ValueError('unrecognized family')
[84] Fix | Delete
[85] Fix | Delete
def _validate_family(family):
[86] Fix | Delete
'''
[87] Fix | Delete
Checks if the family is valid for the current environment.
[88] Fix | Delete
'''
[89] Fix | Delete
if sys.platform != 'win32' and family == 'AF_PIPE':
[90] Fix | Delete
raise ValueError('Family %s is not recognized.' % family)
[91] Fix | Delete
[92] Fix | Delete
if sys.platform == 'win32' and family == 'AF_UNIX':
[93] Fix | Delete
# double check
[94] Fix | Delete
if not hasattr(socket, family):
[95] Fix | Delete
raise ValueError('Family %s is not recognized.' % family)
[96] Fix | Delete
[97] Fix | Delete
def address_type(address):
[98] Fix | Delete
'''
[99] Fix | Delete
Return the types of the address
[100] Fix | Delete
[101] Fix | Delete
This can be 'AF_INET', 'AF_UNIX', or 'AF_PIPE'
[102] Fix | Delete
'''
[103] Fix | Delete
if type(address) == tuple:
[104] Fix | Delete
return 'AF_INET'
[105] Fix | Delete
elif type(address) is str and address.startswith('\\\\'):
[106] Fix | Delete
return 'AF_PIPE'
[107] Fix | Delete
elif type(address) is str or util.is_abstract_socket_namespace(address):
[108] Fix | Delete
return 'AF_UNIX'
[109] Fix | Delete
else:
[110] Fix | Delete
raise ValueError('address type of %r unrecognized' % address)
[111] Fix | Delete
[112] Fix | Delete
#
[113] Fix | Delete
# Connection classes
[114] Fix | Delete
#
[115] Fix | Delete
[116] Fix | Delete
class _ConnectionBase:
[117] Fix | Delete
_handle = None
[118] Fix | Delete
[119] Fix | Delete
def __init__(self, handle, readable=True, writable=True):
[120] Fix | Delete
handle = handle.__index__()
[121] Fix | Delete
if handle < 0:
[122] Fix | Delete
raise ValueError("invalid handle")
[123] Fix | Delete
if not readable and not writable:
[124] Fix | Delete
raise ValueError(
[125] Fix | Delete
"at least one of `readable` and `writable` must be True")
[126] Fix | Delete
self._handle = handle
[127] Fix | Delete
self._readable = readable
[128] Fix | Delete
self._writable = writable
[129] Fix | Delete
[130] Fix | Delete
# XXX should we use util.Finalize instead of a __del__?
[131] Fix | Delete
[132] Fix | Delete
def __del__(self):
[133] Fix | Delete
if self._handle is not None:
[134] Fix | Delete
self._close()
[135] Fix | Delete
[136] Fix | Delete
def _check_closed(self):
[137] Fix | Delete
if self._handle is None:
[138] Fix | Delete
raise OSError("handle is closed")
[139] Fix | Delete
[140] Fix | Delete
def _check_readable(self):
[141] Fix | Delete
if not self._readable:
[142] Fix | Delete
raise OSError("connection is write-only")
[143] Fix | Delete
[144] Fix | Delete
def _check_writable(self):
[145] Fix | Delete
if not self._writable:
[146] Fix | Delete
raise OSError("connection is read-only")
[147] Fix | Delete
[148] Fix | Delete
def _bad_message_length(self):
[149] Fix | Delete
if self._writable:
[150] Fix | Delete
self._readable = False
[151] Fix | Delete
else:
[152] Fix | Delete
self.close()
[153] Fix | Delete
raise OSError("bad message length")
[154] Fix | Delete
[155] Fix | Delete
@property
[156] Fix | Delete
def closed(self):
[157] Fix | Delete
"""True if the connection is closed"""
[158] Fix | Delete
return self._handle is None
[159] Fix | Delete
[160] Fix | Delete
@property
[161] Fix | Delete
def readable(self):
[162] Fix | Delete
"""True if the connection is readable"""
[163] Fix | Delete
return self._readable
[164] Fix | Delete
[165] Fix | Delete
@property
[166] Fix | Delete
def writable(self):
[167] Fix | Delete
"""True if the connection is writable"""
[168] Fix | Delete
return self._writable
[169] Fix | Delete
[170] Fix | Delete
def fileno(self):
[171] Fix | Delete
"""File descriptor or handle of the connection"""
[172] Fix | Delete
self._check_closed()
[173] Fix | Delete
return self._handle
[174] Fix | Delete
[175] Fix | Delete
def close(self):
[176] Fix | Delete
"""Close the connection"""
[177] Fix | Delete
if self._handle is not None:
[178] Fix | Delete
try:
[179] Fix | Delete
self._close()
[180] Fix | Delete
finally:
[181] Fix | Delete
self._handle = None
[182] Fix | Delete
[183] Fix | Delete
def send_bytes(self, buf, offset=0, size=None):
[184] Fix | Delete
"""Send the bytes data from a bytes-like object"""
[185] Fix | Delete
self._check_closed()
[186] Fix | Delete
self._check_writable()
[187] Fix | Delete
m = memoryview(buf)
[188] Fix | Delete
# HACK for byte-indexing of non-bytewise buffers (e.g. array.array)
[189] Fix | Delete
if m.itemsize > 1:
[190] Fix | Delete
m = memoryview(bytes(m))
[191] Fix | Delete
n = len(m)
[192] Fix | Delete
if offset < 0:
[193] Fix | Delete
raise ValueError("offset is negative")
[194] Fix | Delete
if n < offset:
[195] Fix | Delete
raise ValueError("buffer length < offset")
[196] Fix | Delete
if size is None:
[197] Fix | Delete
size = n - offset
[198] Fix | Delete
elif size < 0:
[199] Fix | Delete
raise ValueError("size is negative")
[200] Fix | Delete
elif offset + size > n:
[201] Fix | Delete
raise ValueError("buffer length < offset + size")
[202] Fix | Delete
self._send_bytes(m[offset:offset + size])
[203] Fix | Delete
[204] Fix | Delete
def send(self, obj):
[205] Fix | Delete
"""Send a (picklable) object"""
[206] Fix | Delete
self._check_closed()
[207] Fix | Delete
self._check_writable()
[208] Fix | Delete
self._send_bytes(_ForkingPickler.dumps(obj))
[209] Fix | Delete
[210] Fix | Delete
def recv_bytes(self, maxlength=None):
[211] Fix | Delete
"""
[212] Fix | Delete
Receive bytes data as a bytes object.
[213] Fix | Delete
"""
[214] Fix | Delete
self._check_closed()
[215] Fix | Delete
self._check_readable()
[216] Fix | Delete
if maxlength is not None and maxlength < 0:
[217] Fix | Delete
raise ValueError("negative maxlength")
[218] Fix | Delete
buf = self._recv_bytes(maxlength)
[219] Fix | Delete
if buf is None:
[220] Fix | Delete
self._bad_message_length()
[221] Fix | Delete
return buf.getvalue()
[222] Fix | Delete
[223] Fix | Delete
def recv_bytes_into(self, buf, offset=0):
[224] Fix | Delete
"""
[225] Fix | Delete
Receive bytes data into a writeable bytes-like object.
[226] Fix | Delete
Return the number of bytes read.
[227] Fix | Delete
"""
[228] Fix | Delete
self._check_closed()
[229] Fix | Delete
self._check_readable()
[230] Fix | Delete
with memoryview(buf) as m:
[231] Fix | Delete
# Get bytesize of arbitrary buffer
[232] Fix | Delete
itemsize = m.itemsize
[233] Fix | Delete
bytesize = itemsize * len(m)
[234] Fix | Delete
if offset < 0:
[235] Fix | Delete
raise ValueError("negative offset")
[236] Fix | Delete
elif offset > bytesize:
[237] Fix | Delete
raise ValueError("offset too large")
[238] Fix | Delete
result = self._recv_bytes()
[239] Fix | Delete
size = result.tell()
[240] Fix | Delete
if bytesize < offset + size:
[241] Fix | Delete
raise BufferTooShort(result.getvalue())
[242] Fix | Delete
# Message can fit in dest
[243] Fix | Delete
result.seek(0)
[244] Fix | Delete
result.readinto(m[offset // itemsize :
[245] Fix | Delete
(offset + size) // itemsize])
[246] Fix | Delete
return size
[247] Fix | Delete
[248] Fix | Delete
def recv(self):
[249] Fix | Delete
"""Receive a (picklable) object"""
[250] Fix | Delete
self._check_closed()
[251] Fix | Delete
self._check_readable()
[252] Fix | Delete
buf = self._recv_bytes()
[253] Fix | Delete
return _ForkingPickler.loads(buf.getbuffer())
[254] Fix | Delete
[255] Fix | Delete
def poll(self, timeout=0.0):
[256] Fix | Delete
"""Whether there is any input available to be read"""
[257] Fix | Delete
self._check_closed()
[258] Fix | Delete
self._check_readable()
[259] Fix | Delete
return self._poll(timeout)
[260] Fix | Delete
[261] Fix | Delete
def __enter__(self):
[262] Fix | Delete
return self
[263] Fix | Delete
[264] Fix | Delete
def __exit__(self, exc_type, exc_value, exc_tb):
[265] Fix | Delete
self.close()
[266] Fix | Delete
[267] Fix | Delete
[268] Fix | Delete
if _winapi:
[269] Fix | Delete
[270] Fix | Delete
class PipeConnection(_ConnectionBase):
[271] Fix | Delete
"""
[272] Fix | Delete
Connection class based on a Windows named pipe.
[273] Fix | Delete
Overlapped I/O is used, so the handles must have been created
[274] Fix | Delete
with FILE_FLAG_OVERLAPPED.
[275] Fix | Delete
"""
[276] Fix | Delete
_got_empty_message = False
[277] Fix | Delete
[278] Fix | Delete
def _close(self, _CloseHandle=_winapi.CloseHandle):
[279] Fix | Delete
_CloseHandle(self._handle)
[280] Fix | Delete
[281] Fix | Delete
def _send_bytes(self, buf):
[282] Fix | Delete
ov, err = _winapi.WriteFile(self._handle, buf, overlapped=True)
[283] Fix | Delete
try:
[284] Fix | Delete
if err == _winapi.ERROR_IO_PENDING:
[285] Fix | Delete
waitres = _winapi.WaitForMultipleObjects(
[286] Fix | Delete
[ov.event], False, INFINITE)
[287] Fix | Delete
assert waitres == WAIT_OBJECT_0
[288] Fix | Delete
except:
[289] Fix | Delete
ov.cancel()
[290] Fix | Delete
raise
[291] Fix | Delete
finally:
[292] Fix | Delete
nwritten, err = ov.GetOverlappedResult(True)
[293] Fix | Delete
assert err == 0
[294] Fix | Delete
assert nwritten == len(buf)
[295] Fix | Delete
[296] Fix | Delete
def _recv_bytes(self, maxsize=None):
[297] Fix | Delete
if self._got_empty_message:
[298] Fix | Delete
self._got_empty_message = False
[299] Fix | Delete
return io.BytesIO()
[300] Fix | Delete
else:
[301] Fix | Delete
bsize = 128 if maxsize is None else min(maxsize, 128)
[302] Fix | Delete
try:
[303] Fix | Delete
ov, err = _winapi.ReadFile(self._handle, bsize,
[304] Fix | Delete
overlapped=True)
[305] Fix | Delete
try:
[306] Fix | Delete
if err == _winapi.ERROR_IO_PENDING:
[307] Fix | Delete
waitres = _winapi.WaitForMultipleObjects(
[308] Fix | Delete
[ov.event], False, INFINITE)
[309] Fix | Delete
assert waitres == WAIT_OBJECT_0
[310] Fix | Delete
except:
[311] Fix | Delete
ov.cancel()
[312] Fix | Delete
raise
[313] Fix | Delete
finally:
[314] Fix | Delete
nread, err = ov.GetOverlappedResult(True)
[315] Fix | Delete
if err == 0:
[316] Fix | Delete
f = io.BytesIO()
[317] Fix | Delete
f.write(ov.getbuffer())
[318] Fix | Delete
return f
[319] Fix | Delete
elif err == _winapi.ERROR_MORE_DATA:
[320] Fix | Delete
return self._get_more_data(ov, maxsize)
[321] Fix | Delete
except OSError as e:
[322] Fix | Delete
if e.winerror == _winapi.ERROR_BROKEN_PIPE:
[323] Fix | Delete
raise EOFError
[324] Fix | Delete
else:
[325] Fix | Delete
raise
[326] Fix | Delete
raise RuntimeError("shouldn't get here; expected KeyboardInterrupt")
[327] Fix | Delete
[328] Fix | Delete
def _poll(self, timeout):
[329] Fix | Delete
if (self._got_empty_message or
[330] Fix | Delete
_winapi.PeekNamedPipe(self._handle)[0] != 0):
[331] Fix | Delete
return True
[332] Fix | Delete
return bool(wait([self], timeout))
[333] Fix | Delete
[334] Fix | Delete
def _get_more_data(self, ov, maxsize):
[335] Fix | Delete
buf = ov.getbuffer()
[336] Fix | Delete
f = io.BytesIO()
[337] Fix | Delete
f.write(buf)
[338] Fix | Delete
left = _winapi.PeekNamedPipe(self._handle)[1]
[339] Fix | Delete
assert left > 0
[340] Fix | Delete
if maxsize is not None and len(buf) + left > maxsize:
[341] Fix | Delete
self._bad_message_length()
[342] Fix | Delete
ov, err = _winapi.ReadFile(self._handle, left, overlapped=True)
[343] Fix | Delete
rbytes, err = ov.GetOverlappedResult(True)
[344] Fix | Delete
assert err == 0
[345] Fix | Delete
assert rbytes == left
[346] Fix | Delete
f.write(ov.getbuffer())
[347] Fix | Delete
return f
[348] Fix | Delete
[349] Fix | Delete
[350] Fix | Delete
class Connection(_ConnectionBase):
[351] Fix | Delete
"""
[352] Fix | Delete
Connection class based on an arbitrary file descriptor (Unix only), or
[353] Fix | Delete
a socket handle (Windows).
[354] Fix | Delete
"""
[355] Fix | Delete
[356] Fix | Delete
if _winapi:
[357] Fix | Delete
def _close(self, _close=_multiprocessing.closesocket):
[358] Fix | Delete
_close(self._handle)
[359] Fix | Delete
_write = _multiprocessing.send
[360] Fix | Delete
_read = _multiprocessing.recv
[361] Fix | Delete
else:
[362] Fix | Delete
def _close(self, _close=os.close):
[363] Fix | Delete
_close(self._handle)
[364] Fix | Delete
_write = os.write
[365] Fix | Delete
_read = os.read
[366] Fix | Delete
[367] Fix | Delete
def _send(self, buf, write=_write):
[368] Fix | Delete
remaining = len(buf)
[369] Fix | Delete
while True:
[370] Fix | Delete
n = write(self._handle, buf)
[371] Fix | Delete
remaining -= n
[372] Fix | Delete
if remaining == 0:
[373] Fix | Delete
break
[374] Fix | Delete
buf = buf[n:]
[375] Fix | Delete
[376] Fix | Delete
def _recv(self, size, read=_read):
[377] Fix | Delete
buf = io.BytesIO()
[378] Fix | Delete
handle = self._handle
[379] Fix | Delete
remaining = size
[380] Fix | Delete
while remaining > 0:
[381] Fix | Delete
chunk = read(handle, remaining)
[382] Fix | Delete
n = len(chunk)
[383] Fix | Delete
if n == 0:
[384] Fix | Delete
if remaining == size:
[385] Fix | Delete
raise EOFError
[386] Fix | Delete
else:
[387] Fix | Delete
raise OSError("got end of file during message")
[388] Fix | Delete
buf.write(chunk)
[389] Fix | Delete
remaining -= n
[390] Fix | Delete
return buf
[391] Fix | Delete
[392] Fix | Delete
def _send_bytes(self, buf):
[393] Fix | Delete
n = len(buf)
[394] Fix | Delete
if n > 0x7fffffff:
[395] Fix | Delete
pre_header = struct.pack("!i", -1)
[396] Fix | Delete
header = struct.pack("!Q", n)
[397] Fix | Delete
self._send(pre_header)
[398] Fix | Delete
self._send(header)
[399] Fix | Delete
self._send(buf)
[400] Fix | Delete
else:
[401] Fix | Delete
# For wire compatibility with 3.7 and lower
[402] Fix | Delete
header = struct.pack("!i", n)
[403] Fix | Delete
if n > 16384:
[404] Fix | Delete
# The payload is large so Nagle's algorithm won't be triggered
[405] Fix | Delete
# and we'd better avoid the cost of concatenation.
[406] Fix | Delete
self._send(header)
[407] Fix | Delete
self._send(buf)
[408] Fix | Delete
else:
[409] Fix | Delete
# Issue #20540: concatenate before sending, to avoid delays due
[410] Fix | Delete
# to Nagle's algorithm on a TCP socket.
[411] Fix | Delete
# Also note we want to avoid sending a 0-length buffer separately,
[412] Fix | Delete
# to avoid "broken pipe" errors if the other end closed the pipe.
[413] Fix | Delete
self._send(header + buf)
[414] Fix | Delete
[415] Fix | Delete
def _recv_bytes(self, maxsize=None):
[416] Fix | Delete
buf = self._recv(4)
[417] Fix | Delete
size, = struct.unpack("!i", buf.getvalue())
[418] Fix | Delete
if size == -1:
[419] Fix | Delete
buf = self._recv(8)
[420] Fix | Delete
size, = struct.unpack("!Q", buf.getvalue())
[421] Fix | Delete
if maxsize is not None and size > maxsize:
[422] Fix | Delete
return None
[423] Fix | Delete
return self._recv(size)
[424] Fix | Delete
[425] Fix | Delete
def _poll(self, timeout):
[426] Fix | Delete
r = wait([self], timeout)
[427] Fix | Delete
return bool(r)
[428] Fix | Delete
[429] Fix | Delete
[430] Fix | Delete
#
[431] Fix | Delete
# Public functions
[432] Fix | Delete
#
[433] Fix | Delete
[434] Fix | Delete
class Listener(object):
[435] Fix | Delete
'''
[436] Fix | Delete
Returns a listener object.
[437] Fix | Delete
[438] Fix | Delete
This is a wrapper for a bound socket which is 'listening' for
[439] Fix | Delete
connections, or for a Windows named pipe.
[440] Fix | Delete
'''
[441] Fix | Delete
def __init__(self, address=None, family=None, backlog=1, authkey=None):
[442] Fix | Delete
family = family or (address and address_type(address)) \
[443] Fix | Delete
or default_family
[444] Fix | Delete
address = address or arbitrary_address(family)
[445] Fix | Delete
[446] Fix | Delete
_validate_family(family)
[447] Fix | Delete
if family == 'AF_PIPE':
[448] Fix | Delete
self._listener = PipeListener(address, backlog)
[449] Fix | Delete
else:
[450] Fix | Delete
self._listener = SocketListener(address, family, backlog)
[451] Fix | Delete
[452] Fix | Delete
if authkey is not None and not isinstance(authkey, bytes):
[453] Fix | Delete
raise TypeError('authkey should be a byte string')
[454] Fix | Delete
[455] Fix | Delete
self._authkey = authkey
[456] Fix | Delete
[457] Fix | Delete
def accept(self):
[458] Fix | Delete
'''
[459] Fix | Delete
Accept a connection on the bound socket or named pipe of `self`.
[460] Fix | Delete
[461] Fix | Delete
Returns a `Connection` object.
[462] Fix | Delete
'''
[463] Fix | Delete
if self._listener is None:
[464] Fix | Delete
raise OSError('listener is closed')
[465] Fix | Delete
c = self._listener.accept()
[466] Fix | Delete
if self._authkey:
[467] Fix | Delete
deliver_challenge(c, self._authkey)
[468] Fix | Delete
answer_challenge(c, self._authkey)
[469] Fix | Delete
return c
[470] Fix | Delete
[471] Fix | Delete
def close(self):
[472] Fix | Delete
'''
[473] Fix | Delete
Close the bound socket or named pipe of `self`.
[474] Fix | Delete
'''
[475] Fix | Delete
listener = self._listener
[476] Fix | Delete
if listener is not None:
[477] Fix | Delete
self._listener = None
[478] Fix | Delete
listener.close()
[479] Fix | Delete
[480] Fix | Delete
@property
[481] Fix | Delete
def address(self):
[482] Fix | Delete
return self._listener._address
[483] Fix | Delete
[484] Fix | Delete
@property
[485] Fix | Delete
def last_accepted(self):
[486] Fix | Delete
return self._listener._last_accepted
[487] Fix | Delete
[488] Fix | Delete
def __enter__(self):
[489] Fix | Delete
return self
[490] Fix | Delete
[491] Fix | Delete
def __exit__(self, exc_type, exc_value, exc_tb):
[492] Fix | Delete
self.close()
[493] Fix | Delete
[494] Fix | Delete
[495] Fix | Delete
def Client(address, family=None, authkey=None):
[496] Fix | Delete
'''
[497] Fix | Delete
Returns a connection to the address of a `Listener`
[498] Fix | Delete
'''
[499] Fix | Delete
12
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function