MCPcopy Index your code
hub / github.com/python/cpython / accept

Method accept

Lib/socket.py:292–306  ·  view source on GitHub ↗

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).

(self)

Source from the content-addressed store, hash-verified

290 return sock
291
292 def accept(self):
293 """accept() -> (socket object, address info)
294
295 Wait for an incoming connection. Return a new socket
296 representing the connection, and the address of the client.
297 For IP sockets, the address info is a pair (hostaddr, port).
298 """
299 fd, addr = self._accept()
300 sock = socket(self.family, self.type, self.proto, fileno=fd)
301 # Issue #7995: if no default timeout is set and the listening
302 # socket had a (non-zero) timeout, force the new socket in blocking
303 # mode to override platform-specific socket flags inheritance.
304 if getdefaulttimeout() is None and self.gettimeout():
305 sock.setblocking(True)
306 return sock, addr
307
308 def makefile(self, mode="r", buffering=None, *,
309 encoding=None, errors=None, newline=None):

Callers 1

_fallback_socketpairFunction · 0.45

Calls 4

getdefaulttimeoutFunction · 0.85
socketClass · 0.70
gettimeoutMethod · 0.45
setblockingMethod · 0.45

Tested by

no test coverage detected