Click here to Skip to main content
15,887,027 members
Articles / Programming Languages / C++

Understanding C++20 Coroutines, Awaitable Objects and Operator co_await with Real Samples

Rate me:
Please Sign up or sign in to vote.
4.33/5 (2 votes)
3 Dec 2020CPOL11 min read 13.8K   6  
C++, C++20 Coroutine, Awaitable Object, co_await, Cross Platform Development and Non-blocking Socket Communication
This article will mainly focus on awaitable object, task and co_await. It comes with a real demo sample to demonstrate streaming both requests and responses between client and server with the best network efficiency. The provided sample code as well as others listed at the end can be compiled with GCC 10.0.1 and Visual C++ 2017 or later.

Views

Daily Counts

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Software Developer (Senior)
United States United States
Yuancai (Charlie) Ye, an experienced C/C++ software engineer, lives in Atlanta, Georgia. He is an expert at continuous inline request/result batching, real-time stream processing, asynchronous data transferring and parallel computation for the best communication throughput and latency. He has been working at SocketPro (https://github.com/udaparts/socketpro) for more than fifteen years.

Comments and Discussions