문제

As the server-side part becomes more complex, developers will need to leverage the existing software. So, does Dart support interfacing with the native libraries (C libraries, in particular)?

도움이 되었습니까?

해결책

Yes, it is quite possible, here is the official guide.

Dart programs running on the standalone Dart VM (command-line apps) can call C or C++ functions in a shared library, by means of native extensions. This article shows how to write and build such native extensions on Windows, Mac OS X, and Linux.

You can provide two types of native extensions: asynchronous or synchronous. An asynchronous extension runs a native function on a separate thread, scheduled by the Dart VM. A synchronous extension uses the Dart virtual machine library’s C API (the Dart Embedding API) directly and runs on the same thread as the Dart isolate. An asynchronous function is called by sending a message to a Dart port, receiving the response on a reply port.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top