Please sign in to comment.
Avoid getpeername() syscall in Socket.connected if possible
The Socket.connected property will call getpeername() only if _connecting is True. Even this is probably not necessary, but at least it avoids the syscall in he common case (while socket.connected: [...]) Also check the new IOChannel._closing flag. Socket.connected is False if the close() was called even if the channel isn't actually closed yet (with _close())
- Loading branch information...