Gets the socket address host and port.
(sock)
| 50 | return "127.0.0.1" |
| 51 | |
| 52 | def get_address(sock): |
| 53 | """Gets the socket address host and port.""" |
| 54 | try: |
| 55 | host, port = sock.getsockname()[:2] |
| 56 | except Exception as exc: |
| 57 | log.swallow_exception("Failed to get socket address:") |
| 58 | raise RuntimeError(f"Failed to get socket address: {exc}") from exc |
| 59 | |
| 60 | return host, port |
| 61 | |
| 62 | def create_server(host, port=0, backlog=socket.SOMAXCONN, timeout=None): |
| 63 | """Return a local server socket listening on the given port.""" |
no outgoing calls
no test coverage detected
searching dependent graphs…