6#if defined(DART_HOST_OS_MACOS)
13#include <netinet/tcp.h>
29 int len =
sizeof(errno);
30 getsockopt(fd, SOL_SOCKET, SO_ERROR, &errno,
31 reinterpret_cast<socklen_t*
>(&
len));
37 int result = fstat(fd, &buf);
41 if (S_ISCHR(buf.st_mode)) {
44 if (S_ISFIFO(buf.st_mode)) {
47 if (S_ISREG(buf.st_mode)) {
57 struct addrinfo hints;
58 memset(&hints, 0,
sizeof(hints));
60 hints.ai_socktype = SOCK_STREAM;
62 hints.ai_protocol = IPPROTO_TCP;
63 struct addrinfo*
info =
nullptr;
64 int status = getaddrinfo(
host,
nullptr, &hints, &
info);
66 ASSERT(*os_error ==
nullptr);
72 for (
struct addrinfo* c =
info; c !=
nullptr; c = c->ai_next) {
73 if ((c->ai_family == AF_INET) || (c->ai_family == AF_INET6)) {
78 AddressList<SocketAddress>* addresses =
new AddressList<SocketAddress>(
count);
79 for (
struct addrinfo* c =
info; c !=
nullptr; c = c->ai_next) {
80 if ((c->ai_family == AF_INET) || (c->ai_family == AF_INET6)) {
81 addresses->SetAt(
i,
new SocketAddress(c->ai_addr));
92 u_int on = enabled ? 1 : 0;
95 : IPV6_MULTICAST_LOOP;
97 fd,
level, optname,
reinterpret_cast<char*
>(&on),
sizeof(on))) ==
109static bool JoinOrLeaveMulticast(intptr_t fd,
111 const RawAddr& interface,
114 if (
addr.addr.sa_family == AF_INET) {
115 ASSERT(interface.addr.sa_family == AF_INET);
117 memmove(&mreq.imr_multiaddr, &
addr.in.sin_addr,
119 memmove(&mreq.imr_interface, &interface.in.sin_addr,
123 &mreq,
sizeof(mreq))) == 0;
126 &mreq,
sizeof(mreq))) == 0;
130 struct ipv6_mreq mreq;
131 memmove(&mreq.ipv6mr_multiaddr, &
addr.in6.sin6_addr,
133 mreq.ipv6mr_interface = interfaceIndex;
136 &mreq,
sizeof(mreq))) == 0;
139 &mreq,
sizeof(mreq))) == 0;
146 const RawAddr& interface,
147 int interfaceIndex) {
148 return JoinOrLeaveMulticast(fd,
addr, interface, interfaceIndex,
true);
153 const RawAddr& interface,
154 int interfaceIndex) {
155 return JoinOrLeaveMulticast(fd,
addr, interface, interfaceIndex,
false);
static void info(const char *fmt,...) SK_PRINTF_LIKE(1
static int16_t FromType(int type)
static intptr_t GetInAddrLength(const RawAddr &addr)
static bool LeaveMulticast(intptr_t fd, const RawAddr &addr, const RawAddr &interface, int interfaceIndex)
static int GetType(intptr_t fd)
static AddressList< SocketAddress > * LookupAddress(const char *host, int type, OSError **os_error)
static void GetError(intptr_t fd, OSError *os_error)
static bool SetMulticastLoop(intptr_t fd, intptr_t protocol, bool enabled)
static bool GetOption(intptr_t fd, int level, int option, char *data, unsigned int *length)
static bool JoinMulticast(intptr_t fd, const RawAddr &addr, const RawAddr &interface, int interfaceIndex)
static int8_t data[kExtLength]
DEF_SWITCHES_START aot vmservice shared library Name of the *so containing AOT compiled Dart assets for launching the service isolate vm snapshot The VM snapshot data that will be memory mapped as read only SnapshotAssetPath must be present isolate snapshot The isolate snapshot data that will be memory mapped as read only SnapshotAssetPath must be present cache dir Path to the cache directory This is different from the persistent_cache_path in embedder which is used for Skia shader cache icu native lib Path to the library file that exports the ICU data vm service host
#define NO_RETRY_EXPECTED(expression)
static SkString join(const CommandLineFlags::StringArray &)