Fix and clean up FileDescriptor.isSocket.
The original logic was accidentally inverted. This prevented sockets
from being untagged, which would result in cancelled requests stalling
out with sub-optimal TCP ZeroWindow detection instead of sending RST
packets.
Add a comment explaining how this works.
Switch from SO_ERROR (which has a side-effect) to SO_DEBUG (which doesn't).
Add a unit test.
Bug: 18706592
(cherry picked from commit 4f263fdfcc0c9e3ebadeaa6717e93a130c09320c)
Change-Id: I6746f4e0e5a6c9788cdcf35f74ccca5aa9a0e8b4
2 files changed