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)
| 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): |
no test coverage detected