dart-sdk/runtime
Alexander Aprelev 935ee25f3b [io/unix_domain_socket] Add support for sending/receiving open files, sockets, std streams via sockets.
This adds [sendMessage] and [receiveMessage] methods to [RawSocket] class. They are only supported on Linux at the moment as they require connection opened as unix domain socket connection.

This introduces [SocketControlMessage] class that represents a message sent via socket and also introduces [ResourceHandle] class that wraps [RandomAccessFile], [Socket]/[RawSocket]/[RawDatagramSocket], [Stdin]/[Stdout] for
marshalling/unmarshalling purposes.

Underlying OS implementation supports various kinds of control messages that can be passed via sockets, this CL only adds support for sending/receiving opened file description handles.
When receiving a message recipient can attempt to extract handles out of it via [tryExtractHandles]. It returns [null] if message has no handles to extract.

This is continuation of the work started on https://dart-review.googlesource.com/c/sdk/+/205067.

Bug: https://github.com/dart-lang/sdk/issues/46328
TEST=unix_socket_test

Change-Id: Ic9125b51dc80b677452e454366bae4118c298081
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/212036
Commit-Queue: Alexander Aprelev <aam@google.com>
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
Reviewed-by: Zach Anderson <zra@google.com>
2021-10-08 15:46:23 +00:00
..
bin [io/unix_domain_socket] Add support for sending/receiving open files, sockets, std streams via sockets. 2021-10-08 15:46:23 +00:00
docs Incorrect wording 2021-10-04 08:39:38 +00:00
include [vm] Native API DL: dllexport on Windows 2021-10-06 07:42:44 +00:00
lib [vm/isolates] Ensure that only closure's context is inspected when closure is sent out. 2021-10-07 15:27:43 +00:00
observatory [observatory] Add diffing for process snapshots. 2021-10-06 17:52:49 +00:00
observatory_2 [vm] Remove dead ObjectPool entry type NativeFunctionWrapper. 2021-10-05 22:49:22 +00:00
platform [vm] Give a better error if one tries to build simia32 or simx64. 2021-09-27 23:45:45 +00:00
tests [vm/isolates] Ensure that only closure's context is inspected when closure is sent out. 2021-10-07 15:27:43 +00:00
third_party [tools] Update all iteritems -> items 2021-05-20 11:36:52 +00:00
tools Change references to "dartfmt" in runtime and tools to "dart format". 2021-10-01 18:16:27 +00:00
vm [io/unix_domain_socket] Add support for sending/receiving open files, sockets, std streams via sockets. 2021-10-08 15:46:23 +00:00
.clang-tidy
.gitignore
BUILD.gn Allow deprecated copy on fuchsia 2021-08-11 01:14:22 +00:00
codereview.settings
configs.gni
CPPLINT.cfg
PRESUBMIT.py [python3] Migrate PRESUBMIT.py files 2021-08-16 08:29:54 +00:00
runtime_args.gni [wasm] Remove deprecated dart_enable_wasm flag. 2021-04-01 22:45:07 +00:00