Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3)

Unified Diff: tools/android/forwarder2/socket.h

Issue 2402793002: [Android] Add timeout to unmap reply handling. (Closed)
Patch Set: Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: tools/android/forwarder2/socket.h
diff --git a/tools/android/forwarder2/socket.h b/tools/android/forwarder2/socket.h
index 5e68f16c2cb6df60834a1cedaed90c7fcd7f37ed..55a3a3c1d61a89db0f9db28b06a2030714055e7f 100644
--- a/tools/android/forwarder2/socket.h
+++ b/tools/android/forwarder2/socket.h
@@ -50,6 +50,9 @@ class Socket {
// Returns the number of bytes read.
int Read(void* buffer, size_t buffer_size);
+ // Same as Read() but with a timeout.
+ int ReadWithTimeout(void* buffer, size_t buffer_size, int timeout_secs);
+
// Non-blocking version of Read() above. This must be called after a
// successful call to select(). The socket must also be in non-blocking mode
// before calling this method.
@@ -67,6 +70,9 @@ class Socket {
// of errror.
int ReadNumBytes(void* buffer, size_t num_bytes);
+ // Same as ReadNumBytes() but with a timeout.
+ int ReadNumBytesWithTimeout(void* buffer, size_t num_bytes, int timeout_secs);
+
// Calls Write() multiple times until num_bytes is written. No bounds checking
// is performed. Returns number of bytes written, which can be different from
// num_bytes in case of errror.

Powered by Google App Engine
This is Rietveld 408576698