| commit | 935ee25f3b72e7fe81047220cadae1f61c505da4 | [log] [tgz] |
|---|---|---|
| author | Alexander Aprelev <aam@google.com> | Fri Oct 08 15:46:23 2021 +0000 |
| committer | commit-bot@chromium.org <commit-bot@chromium.org> | Fri Oct 08 15:46:23 2021 +0000 |
| tree | 1b36e4434cafe838408805dbef8cdddf9f988364 | |
| parent | e0c7693b74cdf115d4cf372eb0b9e934bdd883f4 [diff] |
[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>
Dart is:
Optimized for UI: Develop with a programming language specialized around the needs of user interface creation.
Productive: Make changes iteratively: use hot reload to see the result instantly in your running app.
Fast on all platforms: Compile to ARM & x64 machine code for mobile, desktop, and backend. Or compile to JavaScript for the web.
Dart's flexible compiler technology lets you run Dart code in different ways, depending on your target platform and goals:
Dart Native: For programs targeting devices (mobile, desktop, server, and more), Dart Native includes both a Dart VM with JIT (just-in-time) compilation and an AOT (ahead-of-time) compiler for producing machine code.
Dart Web: For programs targeting the web, Dart Web includes both a development time compiler (dartdevc) and a production time compiler (dart2js).
Dart is free and open source.
See LICENSE and PATENT_GRANT.
Visit dart.dev to learn more about the language, tools, and to find codelabs.
Browse pub.dev for more packages and libraries contributed by the community and the Dart team.
Our API reference documentation is published at api.dart.dev, based on the stable release. (We also publish docs from our beta and dev channels, as well as from the primary development branch).
If you want to build Dart yourself, here is a guide to getting the source, preparing your machine to build the SDK, and building.
There are more documents on our wiki.
The easiest way to contribute to Dart is to file issues.
You can also contribute patches, as described in Contributing.