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

Side by Side Diff: runtime/bin/socket.cc

Issue 9837060: Treat EAGAIN/EWOULDBLOCK as requests for retry on socket accept. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Remove error printing Created 8 years, 9 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « runtime/bin/socket.h ('k') | runtime/bin/socket_impl.dart » ('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) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 #include "bin/socket.h" 5 #include "bin/socket.h"
6 #include "bin/dartutils.h" 6 #include "bin/dartutils.h"
7 #include "bin/thread.h" 7 #include "bin/thread.h"
8 #include "bin/utils.h" 8 #include "bin/utils.h"
9 #include "platform/thread.h" 9 #include "platform/thread.h"
10 #include "platform/utils.h" 10 #include "platform/utils.h"
(...skipping 193 matching lines...) Expand 10 before | Expand all | Expand 10 after
204 Dart_EnterScope(); 204 Dart_EnterScope();
205 intptr_t socket = 205 intptr_t socket =
206 DartUtils::GetIntegerField(Dart_GetNativeArgument(args, 0), 206 DartUtils::GetIntegerField(Dart_GetNativeArgument(args, 0),
207 DartUtils::kIdFieldName); 207 DartUtils::kIdFieldName);
208 Dart_Handle socketobj = Dart_GetNativeArgument(args, 1); 208 Dart_Handle socketobj = Dart_GetNativeArgument(args, 1);
209 intptr_t newSocket = ServerSocket::Accept(socket); 209 intptr_t newSocket = ServerSocket::Accept(socket);
210 if (newSocket >= 0) { 210 if (newSocket >= 0) {
211 DartUtils::SetIntegerField( 211 DartUtils::SetIntegerField(
212 socketobj, DartUtils::kIdFieldName, newSocket); 212 socketobj, DartUtils::kIdFieldName, newSocket);
213 Dart_SetReturnValue(args, Dart_True()); 213 Dart_SetReturnValue(args, Dart_True());
214 } else if (newSocket == ServerSocket::kTemporaryFailure) {
215 Dart_SetReturnValue(args, Dart_False());
214 } else { 216 } else {
215 Dart_SetReturnValue(args, DartUtils::NewDartOSError()); 217 Dart_SetReturnValue(args, DartUtils::NewDartOSError());
216 } 218 }
217 Dart_ExitScope(); 219 Dart_ExitScope();
218 } 220 }
219 221
220 222
221 static CObject* LookupRequest(const CObjectArray& request) { 223 static CObject* LookupRequest(const CObjectArray& request) {
222 if (request.Length() == 2 && request[1]->IsString()) { 224 if (request.Length() == 2 && request[1]->IsString()) {
223 CObjectString host(request[1]); 225 CObjectString host(request[1]);
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
289 Dart_EnterScope(); 291 Dart_EnterScope();
290 Dart_SetReturnValue(args, Dart_Null()); 292 Dart_SetReturnValue(args, Dart_Null());
291 Dart_Port service_port = Socket::GetServicePort(); 293 Dart_Port service_port = Socket::GetServicePort();
292 if (service_port != kIllegalPort) { 294 if (service_port != kIllegalPort) {
293 // Return a send port for the service port. 295 // Return a send port for the service port.
294 Dart_Handle send_port = Dart_NewSendPort(service_port); 296 Dart_Handle send_port = Dart_NewSendPort(service_port);
295 Dart_SetReturnValue(args, send_port); 297 Dart_SetReturnValue(args, send_port);
296 } 298 }
297 Dart_ExitScope(); 299 Dart_ExitScope();
298 } 300 }
OLDNEW
« no previous file with comments | « runtime/bin/socket.h ('k') | runtime/bin/socket_impl.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698