30bool Socket::short_socket_read_ =
false;
31bool Socket::short_socket_write_ =
false;
47ListeningSocketRegistry::OSSocket* ListeningSocketRegistry::LookupByPort(
50 GetHashmapKeyFromIntptr(
port), GetHashmapHashFromIntptr(
port),
false);
51 if (entry ==
nullptr) {
54 return reinterpret_cast<OSSocket*
>(entry->
value);
57void ListeningSocketRegistry::InsertByPort(intptr_t
port, OSSocket* socket) {
59 GetHashmapKeyFromIntptr(
port), GetHashmapHashFromIntptr(
port),
true);
61 entry->value =
reinterpret_cast<void*
>(socket);
64void ListeningSocketRegistry::RemoveByPort(intptr_t
port) {
65 sockets_by_port_.
Remove(GetHashmapKeyFromIntptr(
port),
66 GetHashmapHashFromIntptr(
port));
69ListeningSocketRegistry::OSSocket* ListeningSocketRegistry::LookupByFd(
72 GetHashmapKeyFromIntptr(
reinterpret_cast<intptr_t
>(fd)),
73 GetHashmapHashFromIntptr(
reinterpret_cast<intptr_t
>(fd)),
false);
74 if (entry ==
nullptr) {
77 return reinterpret_cast<OSSocket*
>(entry->value);
80void ListeningSocketRegistry::InsertByFd(Socket* fd, OSSocket* socket) {
82 GetHashmapKeyFromIntptr(
reinterpret_cast<intptr_t
>(fd)),
83 GetHashmapHashFromIntptr(
reinterpret_cast<intptr_t
>(fd)),
true);
85 entry->value =
reinterpret_cast<void*
>(socket);
88void ListeningSocketRegistry::RemoveByFd(Socket* fd) {
90 GetHashmapKeyFromIntptr(
reinterpret_cast<intptr_t
>(fd)),
91 GetHashmapHashFromIntptr(
reinterpret_cast<intptr_t
>(fd)));
101 OSSocket* first_os_socket =
nullptr;
104 first_os_socket = LookupByPort(
port);
105 if (first_os_socket !=
nullptr) {
109 OSSocket* os_socket = first_os_socket;
110 OSSocket* os_socket_same_addr = FindOSSocketWithAddress(os_socket,
addr);
112 if (os_socket_same_addr !=
nullptr) {
113 if (!os_socket_same_addr->shared || !shared) {
115 "The shared flag to bind() needs to be `true` if "
116 "binding multiple times on the same (address, port) "
121 if (os_socket_same_addr->v6_only != v6_only) {
123 "The v6Only flag to bind() needs to be the same if "
124 "binding multiple times on the same (address, port) "
135 os_socket_same_addr->ref_count++;
140 InsertByFd(socketfd, os_socket_same_addr);
161 ASSERT(allocated_port > 0);
163 if (allocated_port !=
port) {
178 first_os_socket = LookupByPort(allocated_port);
182 OSSocket* os_socket =
183 new OSSocket(
addr, allocated_port, v6_only, shared, socketfd,
nullptr);
184 os_socket->ref_count = 1;
185 os_socket->next = first_os_socket;
187 InsertByPort(allocated_port, os_socket);
188 InsertByFd(socketfd, os_socket);
212#if defined(DART_HOST_OS_LINUX) || defined(DART_HOST_OS_ANDROID)
218 if (unix_domain_sockets_ !=
nullptr) {
222 OSSocket* os_socket = unix_domain_sockets_;
223 OSSocket* os_socket_same_addr =
224 FindOSSocketWithPath(os_socket, namespc,
addr.un.sun_path);
225 if (os_socket_same_addr !=
nullptr) {
226 if (!os_socket_same_addr->shared || !shared) {
228 "The shared flag to bind() needs to be `true` if "
229 "binding multiple times on the same path.",
239 os_socket_same_addr->ref_count++;
244 InsertByFd(socketfd, os_socket_same_addr);
251 OSError os_error(-1,
"File exists with given unix domain address",
264 OSSocket* os_socket =
265 new OSSocket(
addr, -1,
false, shared, socketfd, namespc);
266 os_socket->ref_count = 1;
267 os_socket->next = unix_domain_sockets_;
268 unix_domain_sockets_ = os_socket;
269 InsertByFd(socketfd, os_socket);
277bool ListeningSocketRegistry::CloseOneSafe(OSSocket* os_socket,
280 ASSERT(os_socket !=
nullptr);
281 ASSERT(os_socket->ref_count > 0);
282 os_socket->ref_count--;
284 if (os_socket->ref_count > 0) {
288 if (os_socket->address.addr.sa_family == AF_UNIX) {
289#if defined(DART_HOST_OS_LINUX) || defined(DART_HOST_OS_ANDROID)
292 if (os_socket->address.un.sun_path[0] !=
'\0') {
299 OSSocket*
prev =
nullptr;
300 OSSocket* current = unix_domain_sockets_;
301 while (current !=
nullptr) {
302 if (current == os_socket) {
303 if (
prev ==
nullptr) {
304 unix_domain_sockets_ = unix_domain_sockets_->next;
306 prev->next = current->next;
311 current = current->next;
316 OSSocket*
prev =
nullptr;
317 OSSocket* current = LookupByPort(os_socket->port);
318 while (current != os_socket) {
319 ASSERT(current !=
nullptr);
321 current = current->next;
324 if ((
prev ==
nullptr) && (current->next ==
nullptr)) {
326 RemoveByPort(os_socket->port);
327 }
else if (
prev ==
nullptr) {
329 InsertByPort(os_socket->port, current->next);
332 prev->next = os_socket->next;
335 ASSERT(os_socket->ref_count == 0);
340void ListeningSocketRegistry::CloseAllSafe() {
343 cursor = sockets_by_fd_.
Next(cursor)) {
344 OSSocket* os_socket =
reinterpret_cast<OSSocket*
>(cursor->value);
345 ASSERT(os_socket !=
nullptr);
352 OSSocket* os_socket = LookupByFd(socketfd);
353 if (os_socket !=
nullptr) {
354 return CloseOneSafe(os_socket, socketfd);
369 if (
addr.addr.sa_family == AF_INET6) {
400 int64_t source_port =
404 if (
addr.addr.sa_family == AF_INET6) {
423#if defined(DART_HOST_OS_WINDOWS) || defined(DART_HOST_OS_FUCHSIA)
425 -1,
"Unix domain sockets are not available on this operating system.",
433 "expect address to be of type String"));
468#if defined(DART_HOST_OS_WINDOWS) || defined(DART_HOST_OS_FUCHSIA)
470 -1,
"Unix domain sockets are not available on this operating system.",
523 if (available >= 0) {
541 uint8_t*
buffer =
nullptr;
550 intptr_t bytes_read =
552 if (bytes_read ==
length) {
554 }
else if (bytes_read > 0) {
555 uint8_t* new_buffer =
nullptr;
563 ASSERT(new_buffer !=
nullptr);
564 memmove(new_buffer,
buffer, bytes_read);
566 }
else if (bytes_read == 0) {
588 const int kReceiveBufferLen = 65536;
593 ASSERT(socket !=
nullptr);
595 if (recv_buffer ==
nullptr) {
596 recv_buffer =
reinterpret_cast<uint8_t*
>(
malloc(kReceiveBufferLen));
604 if (bytes_read == 0) {
608 if (bytes_read < 0) {
615 uint8_t* data_buffer =
nullptr;
623 ASSERT(data_buffer !=
nullptr);
624 memmove(data_buffer, recv_buffer, bytes_read);
630 enum internet_type { IPv4, IPv6 };
632 if (
addr.addr.sa_family == AF_INET) {
633 addr.in.sin_port = 0;
637 addr.in6.sin6_port = 0;
641 char numeric_address[INET6_ADDRSTRLEN];
645 const int kNumArgs = 5;
671 ASSERT(socket !=
nullptr);
673 int64_t buffer_num_bytes = 0;
676 int64_t buffer_num_bytes_allocated = buffer_num_bytes;
677 uint8_t*
buffer =
nullptr;
688 socket->
fd(),
buffer, &buffer_num_bytes, &control_messages,
690 if (messages_read < 0) {
691 ASSERT(messages_read == -1);
697 if (buffer_num_bytes > 0 && buffer_num_bytes != buffer_num_bytes_allocated) {
699 uint8_t* new_buffer =
nullptr;
704 ASSERT(new_buffer !=
nullptr);
705 memmove(new_buffer,
buffer, buffer_num_bytes);
713 for (intptr_t
i = 0;
i < messages_read;
i++) {
728#if defined(DART_HOST_OS_WINDOWS)
731 const bool result = SocketBase::HasPendingWrite(socket->
fd());
733 const bool result =
false;
745 bool short_write =
false;
753 uint8_t*
buffer =
nullptr;
762 intptr_t bytes_written =
764 if (bytes_written >= 0) {
796 intptr_t num_control_messages_pieces;
798 Dart_ListLength(control_message_list_dart, &num_control_messages_pieces));
799 intptr_t num_control_messages = num_control_messages_pieces / 3;
800 ASSERT((num_control_messages * 3) == num_control_messages_pieces);
804 ASSERT(control_messages !=
nullptr);
808 for (intptr_t
i = 0;
i < num_control_messages;
i++, control_message++) {
818 ASSERT(copied_data !=
nullptr);
819 memmove(copied_data,
data.data(),
data.size_in_bytes());
820 new (control_message)
826 intptr_t bytes_written;
832 uint8_t* buffer_at_offset =
833 reinterpret_cast<uint8_t*
>(
data.data()) +
offset;
835 socket->
fd(), buffer_at_offset,
length, control_messages,
839 if (bytes_written < 0) {
863 uint8_t*
buffer =
nullptr;
874 if (bytes_written >= 0) {
905 if (
addr !=
nullptr) {
933 if (os_error.
code() != 0) {
944 FATAL(
"Fatal error in dart:io (socket): %s", msgStr);
977 intptr_t
id =
reinterpret_cast<intptr_t
>(socket);
1005 if (
addr.addr.sa_family == AF_INET6) {
1014 socket_object,
addr, backlog, v6_only, shared);
1020#if defined(DART_HOST_OS_WINDOWS)
1022 -1,
"Unix domain sockets are not available on this operating system.",
1029 "expect address to be of type String"));
1039 socket_object, namespc,
path, backlog, shared);
1048 if (new_socket >= 0) {
1066 if (addresses !=
nullptr) {
1070 for (intptr_t
i = 0;
i < addresses->
count();
i++) {
1080 entry->
SetAt(1, as_string);
1088 entry->
SetAt(3, scope_id);
1090 array->
SetAt(
i + 1, entry);
1108 memset(
reinterpret_cast<void*
>(&
addr), 0,
sizeof(
RawAddr));
1109 if (
len ==
sizeof(in_addr)) {
1110 addr.in.sin_family = AF_INET;
1111 memmove(
reinterpret_cast<void*
>(&
addr.in.sin_addr), addr_object.
Buffer(),
1115 addr.in6.sin6_family = AF_INET6;
1116 memmove(
reinterpret_cast<void*
>(&
addr.in6.sin6_addr),
1121 const intptr_t kMaxHostLength = 1025;
1122 char host[kMaxHostLength];
1141 if (addresses !=
nullptr) {
1145 for (intptr_t
i = 0;
i < addresses->
count();
i++) {
1156 entry->
SetAt(1, as_string);
1164 entry->
SetAt(3, interface_name);
1168 entry->
SetAt(4, interface_index);
1170 array->
SetAt(
i + 1, entry);
1187 intptr_t protocol =
static_cast<intptr_t
>(
1242 intptr_t protocol =
static_cast<intptr_t
>(
1252 socket->
fd(), protocol,
1257 socket->
fd(), protocol,
1286 char*
data =
nullptr;
1296 static_cast<int>(option),
data,
1297 static_cast<int>(
length));
1313 char*
data =
nullptr;
1321 unsigned int int_length =
static_cast<unsigned int>(
length);
1324 static_cast<int>(option),
data, &int_length);
1370 "option to getOptionValue() is outside expected range"));
1384 int interfaceIndex =
1401 int interfaceIndex =
1410 const int kReceiveBufferLen = 1;
1413 ASSERT(socket !=
nullptr);
1415 uint8_t recv_buffer[kReceiveBufferLen];
1441 if (socket->
fd() >= 0) {
1465 switch (finalizer) {
1466 case kFinalizerNormal:
1469 case kFinalizerListening:
1472 case kFinalizerStdio:
1475 case kFinalizerSignal:
1493 ReuseSocketIdNativeField(handle, socket, finalizer);
1504 if (socket ==
nullptr) {
1513#if defined(DART_HOST_OS_WINDOWS) || defined(DART_HOST_OS_FUCHSIA)
1516 "This is not supported on this operating system"));
1525 intptr_t num_handles;
1527 intptr_t num_bytes = num_handles *
sizeof(
int);
1531 for (intptr_t
i = 0;
i < num_handles;
i++) {
1541 reinterpret_cast<const uint8_t*
>(handles),
1550 Dart_New(socket_control_message_impl,
1552 sizeof(dart_new_args) /
sizeof(
Dart_Handle), dart_new_args));
1558#if defined(DART_HOST_OS_WINDOWS) || defined(DART_HOST_OS_FUCHSIA)
1561 "This is not supported on this operating system"));
1571 if (
level != SOL_SOCKET ||
type != SCM_RIGHTS) {
1582 intptr_t bytes_count;
1588 ASSERT(ints_data !=
nullptr);
1589 memmove(ints_data,
data, bytes_count);
1591 intptr_t ints_count = bytes_count /
sizeof(
int);
1599 for (intptr_t
i = 0;
i < ints_count;
i++) {
1605 sizeof(constructor_args) /
sizeof(
Dart_Handle), constructor_args));
1614#if defined(DART_HOST_OS_WINDOWS) || defined(DART_HOST_OS_FUCHSIA)
1617 "This is not supported on this operating system"));
1637 dart_new_args[0] =
result;
1655 "This is not supported on this operating system"));
1659#if defined(DART_HOST_OS_WINDOWS) || defined(DART_HOST_OS_FUCHSIA)
1662 "This is not supported on this operating system"));
1671 ASSERT(socket_address !=
nullptr);
1694 "This is not supported on this operating system"));
static float prev(float f)
static bool ok(int result)
#define FUNCTION_NAME(name)
Entry * Lookup(void *key, uint32_t hash, bool insert)
void Remove(void *key, uint32_t hash)
Entry * Next(Entry *p) const
static int Unlink(const char *path)
T * GetAt(intptr_t i) const
void SetAt(intptr_t index, CObject *value)
const uint8_t * Buffer() const
static Dart_CObject * NewString(const char *str)
static CObject * IllegalArgumentError()
static Dart_CObject * NewArray(intptr_t length)
static Dart_CObject * NewInt32(int32_t value)
static Dart_CObject * NewInt64(int64_t value)
static CObject * NewOSError()
static int64_t GetIntegerValue(Dart_Handle value_obj)
static int64_t GetInt64ValueCheckRange(Dart_Handle value_obj, int64_t lower, int64_t upper)
static constexpr const char * kIOLibURL
static Dart_Handle NewDartOSError()
static bool GetBooleanValue(Dart_Handle bool_obj)
static bool GetInt64Value(Dart_Handle value_obj, int64_t *value)
static const char * GetStringValue(Dart_Handle str_obj)
static Dart_Handle MakeUint8Array(const void *buffer, intptr_t length)
static Dart_Handle NewDartUnsupportedError(const char *message)
static intptr_t GetNativeIntptrArgument(Dart_NativeArguments args, intptr_t index)
static Dart_Handle NewString(const char *str)
static Dart_Handle NewDartArgumentError(const char *message)
static Dart_Handle NewInternalError(const char *message)
static Dart_Handle GetDartType(const char *library_url, const char *class_name)
static intptr_t GetIntptrValue(Dart_Handle value_obj)
static void SendFromNative(intptr_t id, Dart_Port port, int64_t data)
static bool Exists(Namespace *namespc, const char *path)
static File * OpenFD(int fd)
static Dart_Handle Allocate(intptr_t size, uint8_t **buffer)
Dart_Handle CreateBindListen(Dart_Handle socket_object, RawAddr addr, intptr_t backlog, bool v6_only, bool shared)
ListeningSocketRegistry()
bool CloseSafe(Socket *socketfd)
Dart_Handle CreateUnixDomainBindListen(Dart_Handle socket_object, Namespace *namespc, const char *path, intptr_t backlog, bool shared)
static ListeningSocketRegistry * Instance()
static Namespace * GetNamespace(Dart_NativeArguments args, intptr_t index)
static intptr_t CreateBindListen(const RawAddr &addr, intptr_t backlog, bool v6_only=false)
static intptr_t Accept(intptr_t fd)
static bool StartAccept(intptr_t fd)
static intptr_t CreateUnixDomainBindListen(const RawAddr &addr, intptr_t backlog)
static void SetAddrScope(RawAddr *addr, intptr_t scope_id)
static void GetSockAddr(Dart_Handle obj, RawAddr *addr)
static intptr_t GetAddrScope(const RawAddr &addr)
static void SetAddrPort(RawAddr *addr, intptr_t port)
const char * as_string() const
static CObjectUint8Array * ToCObject(const RawAddr &addr)
static Dart_Handle GetUnixDomainSockAddr(const char *path, Namespace *namespc, RawAddr *addr)
static Dart_Handle ToTypedData(const RawAddr &addr)
static intptr_t GetAddrPort(const RawAddr &addr)
const RawAddr & addr() const
static bool LeaveMulticast(intptr_t fd, const RawAddr &addr, const RawAddr &interface, int interfaceIndex)
static bool AvailableDatagram(intptr_t fd, void *buffer, intptr_t num_bytes)
static int GetType(intptr_t fd)
static AddressList< SocketAddress > * LookupAddress(const char *host, int type, OSError **os_error)
static bool SetMulticastHops(intptr_t fd, intptr_t protocol, int value)
static intptr_t GetStdioHandle(intptr_t num)
static intptr_t ReceiveMessage(intptr_t fd, void *buffer, int64_t *p_buffer_num_bytes, SocketControlMessage **p_messages, SocketOpKind sync, OSError *p_oserror)
static bool SetOption(intptr_t fd, int level, int option, const char *data, int length)
static SocketAddress * GetRemotePeer(intptr_t fd, intptr_t *port)
static bool FormatNumericAddress(const RawAddr &addr, char *address, int len)
static bool SetNoDelay(intptr_t fd, bool enabled)
static bool GetSocketName(intptr_t fd, SocketAddress *p_sa)
static intptr_t Available(intptr_t fd)
static void GetError(intptr_t fd, OSError *os_error)
static intptr_t RecvFrom(intptr_t fd, void *buffer, intptr_t num_bytes, RawAddr *addr, SocketOpKind sync)
static intptr_t Read(intptr_t fd, void *buffer, intptr_t num_bytes, SocketOpKind sync)
static bool SetBroadcast(intptr_t fd, bool value)
static bool GetNoDelay(intptr_t fd, bool *enabled)
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 ReverseLookup(const RawAddr &addr, char *host, intptr_t host_len, OSError **os_error)
static intptr_t SendTo(intptr_t fd, const void *buffer, intptr_t num_bytes, const RawAddr &addr, SocketOpKind sync)
static bool GetMulticastHops(intptr_t fd, intptr_t protocol, int *value)
static bool GetMulticastLoop(intptr_t fd, intptr_t protocol, bool *enabled)
static bool JoinMulticast(intptr_t fd, const RawAddr &addr, const RawAddr &interface, int interfaceIndex)
static intptr_t SendMessage(intptr_t fd, void *buffer, size_t buffer_num_bytes, SocketControlMessage *messages, intptr_t num_messages, SocketOpKind sync, OSError *p_oserror)
static AddressList< InterfaceSocketAddress > * ListInterfaces(int type, OSError **os_error)
static bool GetBroadcast(intptr_t fd, bool *value)
static intptr_t Write(intptr_t fd, const void *buffer, intptr_t num_bytes, SocketOpKind sync)
static intptr_t GetPort(intptr_t fd)
static bool IsSignalSocketFlag(intptr_t flag)
static CObject * ListInterfacesRequest(const CObjectArray &request)
static bool short_socket_read()
void set_udp_receive_buffer(uint8_t *buffer)
static CObject * ReverseLookupRequest(const CObjectArray &request)
static bool short_socket_write()
static intptr_t CreateUnixDomainConnect(const RawAddr &addr)
uint8_t * udp_receive_buffer() const
static void SetSocketIdNativeField(Dart_Handle handle, intptr_t id, SocketFinalizer finalizer)
static Socket * GetSocketIdNativeField(Dart_Handle socket)
static intptr_t CreateConnect(const RawAddr &addr)
static intptr_t CreateBindDatagram(const RawAddr &addr, bool reuseAddress, bool reusePort, int ttl=1)
static void ReuseSocketIdNativeField(Dart_Handle handle, Socket *socket, SocketFinalizer finalizer)
static CObject * LookupRequest(const CObjectArray &request)
static intptr_t CreateBindConnect(const RawAddr &addr, const RawAddr &source_addr)
static intptr_t CreateUnixDomainBindConnect(const RawAddr &addr, const RawAddr &source_addr)
struct _Dart_Handle * Dart_Handle
void(* Dart_HandleFinalizer)(void *isolate_callback_data, void *peer)
struct _Dart_NativeArguments * Dart_NativeArguments
FlutterSemanticsFlag flags
G_BEGIN_DECLS G_MODULE_EXPORT FlValue * args
FlKeyEvent uint64_t FlKeyResponderAsyncCallback callback
const uint8_t uint32_t uint32_t GError ** error
void FUNCTION_NAME() Socket_CreateBindDatagram(Dart_NativeArguments args)
static constexpr int kSocketIdNativeField
void FUNCTION_NAME() Socket_GetPort(Dart_NativeArguments args)
void FUNCTION_NAME() Socket_ReceiveMessage(Dart_NativeArguments args)
static void StdioSocketFinalizer(void *isolate_data, void *data)
void FUNCTION_NAME() ResourceHandleImpl_toFile(Dart_NativeArguments args)
void FUNCTION_NAME() Socket_GetFD(Dart_NativeArguments args)
void FUNCTION_NAME() ResourceHandleImpl_toSocket(Dart_NativeArguments args)
static Dart_Handle ThrowIfError(Dart_Handle handle)
void FUNCTION_NAME() Socket_GetError(Dart_NativeArguments args)
void FUNCTION_NAME() Socket_GetRemotePeer(Dart_NativeArguments args)
void FUNCTION_NAME() Socket_JoinMulticast(Dart_NativeArguments args)
ListeningSocketRegistry * globalTcpListeningSocketRegistry
void FUNCTION_NAME() SocketControlMessage_fromHandles(Dart_NativeArguments args)
static void SignalSocketFinalizer(void *isolate_data, void *data)
void FUNCTION_NAME() SocketControlMessageImpl_extractHandles(Dart_NativeArguments args)
void FUNCTION_NAME() RawSocketOption_GetOptionValue(Dart_NativeArguments args)
void FUNCTION_NAME() Socket_Read(Dart_NativeArguments args)
static void NormalSocketFinalizer(void *isolate_data, void *data)
void FUNCTION_NAME() Socket_GetOption(Dart_NativeArguments args)
void FUNCTION_NAME() ServerSocket_CreateBindListen(Dart_NativeArguments args)
void FUNCTION_NAME() ServerSocket_Accept(Dart_NativeArguments args)
void FUNCTION_NAME() Socket_AvailableDatagram(Dart_NativeArguments args)
void FUNCTION_NAME() Socket_RecvFrom(Dart_NativeArguments args)
void FUNCTION_NAME() Socket_SetRawOption(Dart_NativeArguments args)
void FUNCTION_NAME() Socket_LeaveMulticast(Dart_NativeArguments args)
void FUNCTION_NAME() Socket_CreateUnixDomainBindConnect(Dart_NativeArguments args)
void FUNCTION_NAME() Socket_SendMessage(Dart_NativeArguments args)
void FUNCTION_NAME() Socket_SetSocketId(Dart_NativeArguments args)
void FUNCTION_NAME() ServerSocket_CreateUnixDomainBindListen(Dart_NativeArguments args)
void FUNCTION_NAME() Socket_Fatal(Dart_NativeArguments args)
void FUNCTION_NAME() Socket_SendTo(Dart_NativeArguments args)
void FUNCTION_NAME() ResourceHandleImpl_toRawSocket(Dart_NativeArguments args)
void FUNCTION_NAME() ResourceHandleImpl_toRawDatagramSocket(Dart_NativeArguments args)
void FUNCTION_NAME() Socket_CreateBindConnect(Dart_NativeArguments args)
void FUNCTION_NAME() Socket_SetOption(Dart_NativeArguments args)
void FUNCTION_NAME() Socket_GetSocketId(Dart_NativeArguments args)
void FUNCTION_NAME() Socket_GetType(Dart_NativeArguments args)
void FUNCTION_NAME() Socket_GetRawOption(Dart_NativeArguments args)
void FUNCTION_NAME() Socket_GetStdioHandle(Dart_NativeArguments args)
void FUNCTION_NAME() Socket_CreateUnixDomainConnect(Dart_NativeArguments args)
void FUNCTION_NAME() Socket_Available(Dart_NativeArguments args)
static void ListeningSocketFinalizer(void *isolate_data, void *data)
void FUNCTION_NAME() Socket_CreateConnect(Dart_NativeArguments args)
void FUNCTION_NAME() Socket_HasPendingWrite(Dart_NativeArguments args)
void FUNCTION_NAME() Socket_WriteList(Dart_NativeArguments args)
DART_EXPORT Dart_Handle Dart_ListGetAt(Dart_Handle list, intptr_t index)
DART_EXPORT Dart_Handle Dart_False()
DART_EXPORT Dart_Handle Dart_GetNativeInstanceField(Dart_Handle obj, int index, intptr_t *value)
DART_EXPORT Dart_Handle Dart_Invoke(Dart_Handle target, Dart_Handle name, int number_of_arguments, Dart_Handle *arguments)
DART_EXPORT Dart_Handle Dart_True()
DART_EXPORT void Dart_SetBooleanReturnValue(Dart_NativeArguments args, bool retval)
void * malloc(size_t size)
DART_EXPORT Dart_Handle Dart_NewUnhandledExceptionError(Dart_Handle exception)
DART_EXPORT Dart_Handle Dart_NewInteger(int64_t value)
DART_EXPORT void Dart_PropagateError(Dart_Handle handle)
DART_EXPORT Dart_FinalizableHandle Dart_NewFinalizableHandle(Dart_Handle object, void *peer, intptr_t external_allocation_size, Dart_HandleFinalizer callback)
DART_EXPORT Dart_Handle Dart_NewTypedData(Dart_TypedData_Type type, intptr_t length)
DART_EXPORT uint8_t * Dart_ScopeAllocate(intptr_t size)
DART_EXPORT void Dart_SetReturnValue(Dart_NativeArguments args, Dart_Handle retval)
DART_EXPORT Dart_Handle Dart_GetField(Dart_Handle container, Dart_Handle name)
DART_EXPORT Dart_Handle Dart_TypedDataAcquireData(Dart_Handle object, Dart_TypedData_Type *type, void **data, intptr_t *len)
DART_EXPORT Dart_Handle Dart_NewListOfTypeFilled(Dart_Handle element_type, Dart_Handle fill_object, intptr_t length)
DART_EXPORT Dart_Handle Dart_ListSetAt(Dart_Handle list, intptr_t index, Dart_Handle value)
DART_EXPORT Dart_Handle Dart_NewBoolean(bool value)
DART_EXPORT bool Dart_IsError(Dart_Handle handle)
DART_EXPORT Dart_Handle Dart_SetNativeInstanceField(Dart_Handle obj, int index, intptr_t value)
DART_EXPORT void Dart_SetIntegerReturnValue(Dart_NativeArguments args, int64_t retval)
DART_EXPORT Dart_Handle Dart_ListSetAsBytes(Dart_Handle list, intptr_t offset, const uint8_t *native_array, intptr_t length)
DART_EXPORT Dart_Handle Dart_GetNativeArgument(Dart_NativeArguments args, int index)
DART_EXPORT Dart_Handle Dart_TypedDataReleaseData(Dart_Handle object)
DART_EXPORT Dart_Handle Dart_NewApiError(const char *error)
DART_EXPORT Dart_Handle Dart_ListLength(Dart_Handle list, intptr_t *len)
DART_EXPORT Dart_Handle Dart_NewList(intptr_t length)
DART_EXPORT Dart_Handle Dart_LookupLibrary(Dart_Handle url)
DART_EXPORT bool Dart_IsList(Dart_Handle object)
DART_EXPORT Dart_Handle Dart_ThrowException(Dart_Handle exception)
DART_EXPORT bool Dart_IsNull(Dart_Handle object)
DART_EXPORT bool Dart_IsTypedData(Dart_Handle handle)
DART_EXPORT Dart_Handle Dart_Null()
DART_EXPORT Dart_Handle Dart_New(Dart_Handle type, Dart_Handle constructor_name, int number_of_arguments, Dart_Handle *arguments)
static int8_t data[kExtLength]
DART_EXPORT Dart_Handle Dart_NewStringFromCString(const char *str)
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 The hostname IP address on which the Dart VM Service should be served If not defaults to or::depending on whether ipv6 is specified vm service port
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
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
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 The hostname IP address on which the Dart VM Service should be served If not defaults to or::depending on whether ipv6 is specified vm service A custom Dart VM Service port The default is to pick a randomly available open port disable vm Disable the Dart VM Service The Dart VM Service is never available in release mode disable vm service Disable mDNS Dart VM Service publication Bind to the IPv6 localhost address for the Dart VM Service Ignored if vm service host is set endless trace buffer