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

Side by Side Diff: runtime/bin/socket_macos.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_linux.cc ('k') | runtime/bin/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) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, 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_MACOS) 6 #if defined(TARGET_OS_MACOS)
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 395 matching lines...) Expand 10 before | Expand all | Expand 10 after
406 if (NO_RETRY_EXPECTED(listen(fd, backlog > 0 ? backlog : SOMAXCONN)) != 0) { 406 if (NO_RETRY_EXPECTED(listen(fd, backlog > 0 ? backlog : SOMAXCONN)) != 0) {
407 VOID_TEMP_FAILURE_RETRY(close(fd)); 407 VOID_TEMP_FAILURE_RETRY(close(fd));
408 return -1; 408 return -1;
409 } 409 }
410 410
411 Socket::SetNonBlocking(fd); 411 Socket::SetNonBlocking(fd);
412 return fd; 412 return fd;
413 } 413 }
414 414
415 415
416 bool ServerSocket::StartAccept(intptr_t fd) {
417 USE(fd);
418 return true;
419 }
420
421
416 intptr_t ServerSocket::Accept(intptr_t fd) { 422 intptr_t ServerSocket::Accept(intptr_t fd) {
417 intptr_t socket; 423 intptr_t socket;
418 struct sockaddr clientaddr; 424 struct sockaddr clientaddr;
419 socklen_t addrlen = sizeof(clientaddr); 425 socklen_t addrlen = sizeof(clientaddr);
420 socket = TEMP_FAILURE_RETRY(accept(fd, &clientaddr, &addrlen)); 426 socket = TEMP_FAILURE_RETRY(accept(fd, &clientaddr, &addrlen));
421 if (socket == -1) { 427 if (socket == -1) {
422 if (errno == EAGAIN) { 428 if (errno == EAGAIN) {
423 // We need to signal to the caller that this is actually not an 429 // We need to signal to the caller that this is actually not an
424 // error. We got woken up from the poll on the listening socket, 430 // error. We got woken up from the poll on the listening socket,
425 // but there is no connection ready to be accepted. 431 // but there is no connection ready to be accepted.
(...skipping 187 matching lines...) Expand 10 before | Expand all | Expand 10 after
613 619
614 bool Socket::LeaveMulticast( 620 bool Socket::LeaveMulticast(
615 intptr_t fd, RawAddr* addr, RawAddr* interface, int interfaceIndex) { 621 intptr_t fd, RawAddr* addr, RawAddr* interface, int interfaceIndex) {
616 return JoinOrLeaveMulticast(fd, addr, interface, interfaceIndex, false); 622 return JoinOrLeaveMulticast(fd, addr, interface, interfaceIndex, false);
617 } 623 }
618 624
619 } // namespace bin 625 } // namespace bin
620 } // namespace dart 626 } // namespace dart
621 627
622 #endif // defined(TARGET_OS_MACOS) 628 #endif // defined(TARGET_OS_MACOS)
OLDNEW
« no previous file with comments | « runtime/bin/socket_linux.cc ('k') | runtime/bin/socket_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698