History log of /libcore/luni/src/main/native/AsynchronousSocketCloseMonitor.cpp
Revision Date Author Comments
6c1e5f4ad36c1f51687aa2b059e998a7c2db2e36 26-Jan-2013 Elliott Hughes <enh@google.com> Manually update the libcore native code.

Cherry-picking all the individual tiny cleanups from the internal branch was
too hard.

Change-Id: Ib97643d3502295685390854c9edd97c93c4c2ecf
679cf68b607e9b4a3beb8bcdee06868ae583386f 08-Jan-2012 Steve Block <steveblock@google.com> Rename (IF_)LOGE(_IF) to (IF_)ALOGE(_IF) DO NOT MERGE

See https://android-git.corp.google.com/g/#/c/157220

Bug: 5449033
Change-Id: I3deb0b1b71cf4ec6d82921a2e0015c3a7b397cbf
9f2b1b1c3bf9de560f29f257c855c7c85b405c0f 07-Aug-2010 Elliott Hughes <enh@google.com> Make network I/O interruptible.

Every thread about to block on network I/O registers its thread id and
the fd it's going to block on. In close, we scan the list and signal
every thread that's blocked on the fd we're closing. They wake up with
EINTR, see that their java.io.FileDescriptor has been invalidated (by
the close code), and infer that this EINTR is not to be retried: this
EINTR implies that they should throw.

This patch also fixes a couple of bugs in accept. We were trying (and,
obviously, failing) to reset SO_RCVTIMEO on fd -1 if the accept failed,
and then throwing an exception relating to that rather than the failed
accept(2). We were also not treating timeouts as a special case of
failure and throwing the appropriate SocketTimeoutException. (One has
to suspect that there's an errno-to-Exception function that we could
write that would work for all this native code.)

This patch also cleans up connect a little more. I've inlined doConnect
into its single caller, I've removed the bogus use of 100ms polling,
and I've rewritten the checking for success/failure to be based on the
advice in Stevens' "Unix Network Programming".

Bug: 2823977
Change-Id: I4f0cbd95be9ba25368be166008855a80c5d30845