Merge "Fix receive timeout on LocalSocket" am: 7a9c0cd854

am: 680ec020a1

Change-Id: I9b5622a91cf459844ee3513191b45994d51c86a7
This commit is contained in:
Neil Fuller
2016-08-31 16:43:22 +00:00
committed by android-build-merger

View File

@@ -516,13 +516,11 @@ class LocalSocketImpl
Os.setsockoptLinger(fd, OsConstants.SOL_SOCKET, OsConstants.SO_LINGER, linger); Os.setsockoptLinger(fd, OsConstants.SOL_SOCKET, OsConstants.SO_LINGER, linger);
break; break;
case SocketOptions.SO_TIMEOUT: case SocketOptions.SO_TIMEOUT:
/* // The option must set both send and receive timeouts.
* SO_TIMEOUT from the core library gets converted to // Note: The incoming timeout value is in milliseconds.
* SO_SNDTIMEO, but the option is supposed to set both
* send and receive timeouts. Note: The incoming timeout
* value is in milliseconds.
*/
StructTimeval timeval = StructTimeval.fromMillis(intValue); StructTimeval timeval = StructTimeval.fromMillis(intValue);
Os.setsockoptTimeval(fd, OsConstants.SOL_SOCKET, OsConstants.SO_RCVTIMEO,
timeval);
Os.setsockoptTimeval(fd, OsConstants.SOL_SOCKET, OsConstants.SO_SNDTIMEO, Os.setsockoptTimeval(fd, OsConstants.SOL_SOCKET, OsConstants.SO_SNDTIMEO,
timeval); timeval);
break; break;