We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
In C#, there is a method like this (pseudo code):
class NetworkStream : Stream { ... } class SslStream : AuthenticatedStream { ... } class AuthenticatedStream : Stream { ... } void Read(Stream local) { byte[] buf = new byte[1024]; while(true) { int n = await from.ReadAsync(buf, 0, buf.Length); ... } }
//Http: var stream = new NetworkStream(socket); //Https: var stream = new SslStream(new NetworkStream(socket)); //Use: Trans(stream);
In Asio, I tried this approach, but it requires writing code in the header file. Is there a better way?
template<typename StreamType> auto Trans(StreamType& local) -> awaitable<void> { char buf[1024]; while(true) { size_t n = co_await local.async_read_some(buffer(buf), use_awaitable); ... } }
(I'm writing an HTTP and HTTPS proxy program, and I need to use this method.)
Thanks!
The text was updated successfully, but these errors were encountered:
No branches or pull requests
In C#, there is a method like this (pseudo code):
In Asio, I tried this approach, but it requires writing code in the header file. Is there a better way?
(I'm writing an HTTP and HTTPS proxy program, and I need to use this method.)
Thanks!
The text was updated successfully, but these errors were encountered: