idealvin / gitalk

comments for Alvin's blog
0 stars 0 forks source link

Use third-party network libraries | Documents for Coost #108

Open idealvin opened 1 year ago

idealvin commented 1 year ago

https://coostdocs.github.io/en/co/net/third/

Use third-party network libraries in coroutines There are two ways to use third-party network libraries in coroutines:

Directly use the blocking APIs of the third-party network library. This is the simplest way, but it relies on the system API hook in coost. Use the non-blocking APIs of the third-party network library. In this way, users need to convert the APIs to synchronous manner with co::io_event. #System API hook API hook simply intercepts system API requests.