Files
sdk/samples/ffi/http/README.md
T
Liam Appelbe baaf5e1116 [ffi] Reland the iNativeCallable.listener example test.
The documentation changes already relanded. This is just relanding the
example.

Patchset 1 is a pure reland. Other patchsets are fixes.

Original CL:
https://dart-review.googlesource.com/c/sdk/+/326580

Change-Id: I04d24d63f08a351db7a6e43f331904274e28e2d5
Bug: https://github.com/dart-lang/sdk/issues/53435
TEST=samples/ffi/http/test/http_test.dart
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/328681
Commit-Queue: Liam Appelbe <liama@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
2023-09-28 22:41:42 +00:00

436 B

This is an example that shows how to use NativeCallable.listener to interact with a multi threaded native API.

The native API is a fake HTTP library with some hard coded requests and responses. To build the dynamic library, run this command:

c++ -shared -fpic lib/fake_http.cc -lstdc++ -o lib/libfake_http.so

On Windows the output library should be lib/fake_http.dll and on Mac it should be lib/libfake_http.dylib.