adb: improve network error info
- Because we have detailed info about which syscall failed (at least
on Win32), use a more generic prefix of "cannot bind listener" followed
by the detailed info.
- Return string errors for a few errors even though I don't think any
callers actually output the string for those errors.
- Remove the printf since the callers print the message themselves.
- LOG(FATAL) calls abort() which on Windows calls the Windows Error
Reporting service which pops up a dialog asking if you want a
crashdump to be uploaded to Microsoft. So really, abort() is
designed for app bugs. Windows isn't the only one doing this, Chromium
also makes LOG(FATAL) crashdump-ready. Since an error here is not
necessarily an app-bug, use a 'normal' error output API like fatal()
which prints an error and just uses exit().
- When Winsock APIs fail, make the string clarify which API failed.
Use terse unix-style descriptions (like what you'd get from
- Don't trace WSAEWOULDBLOCK from recv() which is a normal occurrence.
- Add a comment about WSAEWOULDBLOCK => EAGAIN.
Signed-off-by: Spencer Low <CompareAndSwap@gmail.com>
4 files changed