MCPcopy Index your code
hub / github.com/RustPython/RustPython / accept

Method accept

Lib/socket.py:291–305  ·  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

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

Callers 1

_fallback_socketpairFunction · 0.45

Calls 5

_acceptMethod · 0.80
socketClass · 0.70
getdefaulttimeoutFunction · 0.50
gettimeoutMethod · 0.45
setblockingMethod · 0.45

Tested by

no test coverage detected