| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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) |
| OLD | NEW |