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

Unified Diff: base/sync_socket.h

Issue 464020: Add non-blocking peek for the syncsocket... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years 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
« no previous file with comments | « no previous file | base/sync_socket_posix.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/sync_socket.h
===================================================================
--- base/sync_socket.h (revision 33599)
+++ base/sync_socket.h (working copy)
@@ -51,6 +51,12 @@
// Returns the number of bytes received, or 0 upon failure.
size_t Receive(void* buffer, size_t length);
+ // Returns the number of bytes available. If non-zero, Receive() will not
+ // not block when called. NOTE: Some implementations cannot reliably
+ // determine the number of bytes available so avoid using the returned
+ // size as a promise and simply test against zero.
+ size_t Peek();
+
// Extracts the contained handle. Used for transferring between
// processes.
Handle handle() const { return handle_; }
« no previous file with comments | « no previous file | base/sync_socket_posix.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698