-
Notifications
You must be signed in to change notification settings - Fork 84
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
Add async support for DTLS #253
Conversation
bors cancel |
1 similar comment
bors cancel |
async fn send(&mut self, buf: &[u8]) -> IoResult<usize> { | ||
self.io_mut() | ||
.ok_or(IoError::new(IoErrorKind::Other, "stream has been shutdown"))? | ||
.send(buf) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How does MbedTLS buffering work in DTLS?
// Could implement by using `async-trait` crate or | ||
// #![feature(async_fn_in_trait)] or Associated Types | ||
async fn send(&mut self, buf: &[u8]) -> IoResult<usize> { | ||
self.io_mut() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This doesn't seem correct? You need to call mbedtls_ssl_write here. Same issue for recv. I think you can avoid async-trait and some headache if you model this with fn poll_recv
and fn poll_send
instead of async fn
.
This old PR need to rebase on to |
Close this, since it's no longer needed. |
To keep things simple, the async support for DTLS is implemented by:
ConnectedAsyncUdpSocket
AsyncRead
andAsyncWrite
forConnectedAsyncUdpSocket
async-session
test for testing DTLS