| OLD | NEW |
| 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_LINUX) | 6 #if defined(TARGET_OS_LINUX) |
| 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 388 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 399 | 399 |
| 400 if (NO_RETRY_EXPECTED(listen(fd, backlog > 0 ? backlog : SOMAXCONN)) != 0) { | 400 if (NO_RETRY_EXPECTED(listen(fd, backlog > 0 ? backlog : SOMAXCONN)) != 0) { |
| 401 VOID_TEMP_FAILURE_RETRY(close(fd)); | 401 VOID_TEMP_FAILURE_RETRY(close(fd)); |
| 402 return -1; | 402 return -1; |
| 403 } | 403 } |
| 404 | 404 |
| 405 return fd; | 405 return fd; |
| 406 } | 406 } |
| 407 | 407 |
| 408 | 408 |
| 409 bool ServerSocket::StartAccept(intptr_t fd) { |
| 410 USE(fd); |
| 411 return true; |
| 412 } |
| 413 |
| 414 |
| 409 static bool IsTemporaryAcceptError(int error) { | 415 static bool IsTemporaryAcceptError(int error) { |
| 410 // On Linux a number of protocol errors should be treated as EAGAIN. | 416 // On Linux a number of protocol errors should be treated as EAGAIN. |
| 411 // These are the ones for TCP/IP. | 417 // These are the ones for TCP/IP. |
| 412 return (error == EAGAIN) || (error == ENETDOWN) || (error == EPROTO) || | 418 return (error == EAGAIN) || (error == ENETDOWN) || (error == EPROTO) || |
| 413 (error == ENOPROTOOPT) || (error == EHOSTDOWN) || (error == ENONET) || | 419 (error == ENOPROTOOPT) || (error == EHOSTDOWN) || (error == ENONET) || |
| 414 (error == EHOSTUNREACH) || (error == EOPNOTSUPP) || | 420 (error == EHOSTUNREACH) || (error == EOPNOTSUPP) || |
| 415 (error == ENETUNREACH); | 421 (error == ENETUNREACH); |
| 416 } | 422 } |
| 417 | 423 |
| 418 | 424 |
| (...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 560 mreq.gr_interface = interfaceIndex; | 566 mreq.gr_interface = interfaceIndex; |
| 561 memmove(&mreq.gr_group, &addr->ss, SocketAddress::GetAddrLength(addr)); | 567 memmove(&mreq.gr_group, &addr->ss, SocketAddress::GetAddrLength(addr)); |
| 562 return NO_RETRY_EXPECTED( | 568 return NO_RETRY_EXPECTED( |
| 563 setsockopt(fd, proto, MCAST_LEAVE_GROUP, &mreq, sizeof(mreq))) == 0; | 569 setsockopt(fd, proto, MCAST_LEAVE_GROUP, &mreq, sizeof(mreq))) == 0; |
| 564 } | 570 } |
| 565 | 571 |
| 566 } // namespace bin | 572 } // namespace bin |
| 567 } // namespace dart | 573 } // namespace dart |
| 568 | 574 |
| 569 #endif // defined(TARGET_OS_LINUX) | 575 #endif // defined(TARGET_OS_LINUX) |
| OLD | NEW |