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

Side by Side Diff: base/sync_socket_posix.cc

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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « base/sync_socket.h ('k') | base/sync_socket_win.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "base/sync_socket.h" 5 #include "base/sync_socket.h"
6 6
7 #include <errno.h> 7 #include <errno.h>
8 #include <limits.h> 8 #include <limits.h>
9 #include <stdio.h> 9 #include <stdio.h>
10 #include <sys/types.h> 10 #include <sys/types.h>
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after
91 size_t SyncSocket::Receive(void* buffer, size_t length) { 91 size_t SyncSocket::Receive(void* buffer, size_t length) {
92 DCHECK(length <= kMaxMessageLength); 92 DCHECK(length <= kMaxMessageLength);
93 char* charbuffer = static_cast<char*>(buffer); 93 char* charbuffer = static_cast<char*>(buffer);
94 if (file_util::ReadFromFD(handle_, charbuffer, length)) { 94 if (file_util::ReadFromFD(handle_, charbuffer, length)) {
95 return length; 95 return length;
96 } else { 96 } else {
97 return -1; 97 return -1;
98 } 98 }
99 } 99 }
100 100
101 // TODO(port). Some kind of select?
102 size_t SyncSocket::Peek() {
103 NOTIMPLEMENTED();
104 return 0;
105 }
106
101 } // namespace base 107 } // namespace base
OLDNEW
« no previous file with comments | « base/sync_socket.h ('k') | base/sync_socket_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698