Files
sdk/samples/ffi/http
Alexander Aprelev 828eb40b37 [ffi/samples] Avoid using mismatched strdup/CoTaskMemFree on Windows.
Fixes https://github.com/dart-lang/sdk/issues/61307
TEST=samples/ffi/http on windows

Change-Id: Ibc900896ccb0ea1472b4360cfb7b615fc06efd87
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/445108
Commit-Queue: Alexander Aprelev <aam@google.com>
Reviewed-by: Liam Appelbe <liama@google.com>
2025-08-14 07:57:39 -07:00
..

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.