-
Notifications
You must be signed in to change notification settings - Fork 2.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Integration with event loop libraries #690
Comments
Yes. mbedTLS can be used to integrate with any I/O framework of your choosing. mbedTLS is not tied to any I/O framework, and can be used in a completely non-blocking manner. You simply provide a read and write callback, which consume data from any stream/buffer/event queue of your choosing. The read callback supports returning "no more data" and the write callback allows applying backpressure. When you receive readability and writability notifications from your I/O framework, you simply call mbedtls_ssl_read/write to prompt it to consume/generate fresh data. It's pretty much an ideal API, from my point of view as a user. At my company, we use mbedTLS in desktop & mobile applications, with a cross-platform event loop that runs on a wide variety of frameworks (WinSock, CoreFoundation, unix select, Android NDK Looper, etc) - each of these is able to feed our cross-platform I/O streams, and those streams are used to feed mbedTLS without any platform-specific code needed. I found it pretty painless to integrate mbedTLS with our streams, including backpressure and lazy buffering on read/write; hopefully libuv shouldn't either present a mismatch with the mbedTLS model. |
…2004329 Merge development into development restricted
libevent, libuv, etc.
I understand there are BIO functions in mbedtls. Can these be used to integrate with asynchronous eventloop libraries like libuv (which is used in node.js) ?
The text was updated successfully, but these errors were encountered: