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 "bin/socket.h" |
| 9 #include "bin/socket_android.h" |
| 10 |
8 #include <errno.h> // NOLINT | 11 #include <errno.h> // NOLINT |
9 #include <stdio.h> // NOLINT | 12 #include <stdio.h> // NOLINT |
10 #include <stdlib.h> // NOLINT | 13 #include <stdlib.h> // NOLINT |
11 #include <string.h> // NOLINT | 14 #include <string.h> // NOLINT |
12 #include <sys/stat.h> // NOLINT | 15 #include <sys/stat.h> // NOLINT |
13 #include <unistd.h> // NOLINT | 16 #include <unistd.h> // NOLINT |
14 #include <netinet/tcp.h> // NOLINT | 17 #include <netinet/tcp.h> // NOLINT |
15 | 18 |
16 #include "bin/fdutils.h" | 19 #include "bin/fdutils.h" |
17 #include "bin/file.h" | 20 #include "bin/file.h" |
18 #include "bin/socket.h" | |
19 | |
20 #include "platform/signal_blocker.h" | 21 #include "platform/signal_blocker.h" |
21 | 22 |
22 | |
23 namespace dart { | 23 namespace dart { |
24 namespace bin { | 24 namespace bin { |
25 | 25 |
26 SocketAddress::SocketAddress(struct sockaddr* sa) { | 26 SocketAddress::SocketAddress(struct sockaddr* sa) { |
27 ASSERT(INET6_ADDRSTRLEN >= INET_ADDRSTRLEN); | 27 ASSERT(INET6_ADDRSTRLEN >= INET_ADDRSTRLEN); |
28 if (!Socket::FormatNumericAddress( | 28 if (!Socket::FormatNumericAddress( |
29 *reinterpret_cast<RawAddr*>(sa), as_string_, INET6_ADDRSTRLEN)) { | 29 *reinterpret_cast<RawAddr*>(sa), as_string_, INET6_ADDRSTRLEN)) { |
30 as_string_[0] = 0; | 30 as_string_[0] = 0; |
31 } | 31 } |
32 socklen_t salen = GetAddrLength(*reinterpret_cast<RawAddr*>(sa)); | 32 socklen_t salen = GetAddrLength(*reinterpret_cast<RawAddr*>(sa)); |
(...skipping 522 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
555 mreq.gr_interface = interfaceIndex; | 555 mreq.gr_interface = interfaceIndex; |
556 memmove(&mreq.gr_group, &addr.ss, SocketAddress::GetAddrLength(addr)); | 556 memmove(&mreq.gr_group, &addr.ss, SocketAddress::GetAddrLength(addr)); |
557 return NO_RETRY_EXPECTED(setsockopt( | 557 return NO_RETRY_EXPECTED(setsockopt( |
558 fd, proto, MCAST_LEAVE_GROUP, &mreq, sizeof(mreq))) == 0; | 558 fd, proto, MCAST_LEAVE_GROUP, &mreq, sizeof(mreq))) == 0; |
559 } | 559 } |
560 | 560 |
561 } // namespace bin | 561 } // namespace bin |
562 } // namespace dart | 562 } // namespace dart |
563 | 563 |
564 #endif // defined(TARGET_OS_ANDROID) | 564 #endif // defined(TARGET_OS_ANDROID) |
OLD | NEW |