Merge "Fix receive timeout on LocalSocket" am: 7a9c0cd854 am: 680ec020a1
am: ef1fb4889a
Change-Id: Ie4befe516f369d903a61f22aab15e40ac09193a3
This commit is contained in:
@@ -516,13 +516,11 @@ class LocalSocketImpl
|
||||
Os.setsockoptLinger(fd, OsConstants.SOL_SOCKET, OsConstants.SO_LINGER, linger);
|
||||
break;
|
||||
case SocketOptions.SO_TIMEOUT:
|
||||
/*
|
||||
* SO_TIMEOUT from the core library gets converted to
|
||||
* SO_SNDTIMEO, but the option is supposed to set both
|
||||
* send and receive timeouts. Note: The incoming timeout
|
||||
* value is in milliseconds.
|
||||
*/
|
||||
// The option must set both send and receive timeouts.
|
||||
// Note: The incoming timeout value is in milliseconds.
|
||||
StructTimeval timeval = StructTimeval.fromMillis(intValue);
|
||||
Os.setsockoptTimeval(fd, OsConstants.SOL_SOCKET, OsConstants.SO_RCVTIMEO,
|
||||
timeval);
|
||||
Os.setsockoptTimeval(fd, OsConstants.SOL_SOCKET, OsConstants.SO_SNDTIMEO,
|
||||
timeval);
|
||||
break;
|
||||
|
||||
Reference in New Issue
Block a user