MCPcopy Create free account
hub / github.com/RT-Thread/env-windows / accept

Method accept

tools/python-3.11.9-amd64/Lib/socket.py:287–301  ·  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

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

Callers 1

socketpairFunction · 0.45

Calls 3

socketClass · 0.85
setblockingMethod · 0.80
gettimeoutMethod · 0.45

Tested by

no test coverage detected