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

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

Issue 426613002: Start accepting incoming sockets earlier on Windows, to associate a at AcceptEx error to 'ServerSoc… (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 4 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.cc ('k') | runtime/bin/socket_linux.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) 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 "platform/globals.h" 5 #include "platform/globals.h"
6 #if defined(TARGET_OS_ANDROID) 6 #if defined(TARGET_OS_ANDROID)
7 7
8 #include <errno.h> // NOLINT 8 #include <errno.h> // NOLINT
9 #include <stdio.h> // NOLINT 9 #include <stdio.h> // NOLINT
10 #include <stdlib.h> // NOLINT 10 #include <stdlib.h> // NOLINT
(...skipping 362 matching lines...) Expand 10 before | Expand all | Expand 10 after
373 if (NO_RETRY_EXPECTED(listen(fd, backlog > 0 ? backlog : SOMAXCONN)) != 0) { 373 if (NO_RETRY_EXPECTED(listen(fd, backlog > 0 ? backlog : SOMAXCONN)) != 0) {
374 VOID_TEMP_FAILURE_RETRY(close(fd)); 374 VOID_TEMP_FAILURE_RETRY(close(fd));
375 return -1; 375 return -1;
376 } 376 }
377 377
378 Socket::SetNonBlocking(fd); 378 Socket::SetNonBlocking(fd);
379 return fd; 379 return fd;
380 } 380 }
381 381
382 382
383 bool ServerSocket::StartAccept(intptr_t fd) {
384 USE(fd);
385 return true;
386 }
387
388
383 static bool IsTemporaryAcceptError(int error) { 389 static bool IsTemporaryAcceptError(int error) {
384 // On Android a number of protocol errors should be treated as EAGAIN. 390 // On Android a number of protocol errors should be treated as EAGAIN.
385 // These are the ones for TCP/IP. 391 // These are the ones for TCP/IP.
386 return (error == EAGAIN) || (error == ENETDOWN) || (error == EPROTO) || 392 return (error == EAGAIN) || (error == ENETDOWN) || (error == EPROTO) ||
387 (error == ENOPROTOOPT) || (error == EHOSTDOWN) || (error == ENONET) || 393 (error == ENOPROTOOPT) || (error == EHOSTDOWN) || (error == ENONET) ||
388 (error == EHOSTUNREACH) || (error == EOPNOTSUPP) || 394 (error == EHOSTUNREACH) || (error == EOPNOTSUPP) ||
389 (error == ENETUNREACH); 395 (error == ENETUNREACH);
390 } 396 }
391 397
392 398
(...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after
561 mreq.gr_interface = interfaceIndex; 567 mreq.gr_interface = interfaceIndex;
562 memmove(&mreq.gr_group, &addr->ss, SocketAddress::GetAddrLength(addr)); 568 memmove(&mreq.gr_group, &addr->ss, SocketAddress::GetAddrLength(addr));
563 return NO_RETRY_EXPECTED(setsockopt( 569 return NO_RETRY_EXPECTED(setsockopt(
564 fd, proto, MCAST_LEAVE_GROUP, &mreq, sizeof(mreq))) == 0; 570 fd, proto, MCAST_LEAVE_GROUP, &mreq, sizeof(mreq))) == 0;
565 } 571 }
566 572
567 } // namespace bin 573 } // namespace bin
568 } // namespace dart 574 } // namespace dart
569 575
570 #endif // defined(TARGET_OS_ANDROID) 576 #endif // defined(TARGET_OS_ANDROID)
OLDNEW
« no previous file with comments | « runtime/bin/socket.cc ('k') | runtime/bin/socket_linux.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698