When asyncio transport.get_extra_info('peername') returns None?

Viewed 568

Sometimes my asyncio transports return None instead of IP address and port:

address, port = transport.get_extra_info('peername')

Here is what docs say:

'peername': the remote address to which the socket is connected, result of socket.socket.getpeername() (None on error)

However, nothing is said about the reasons causing the error. Should I try again? Should I close this connection immediately?

0 Answers
Related