Skip to content
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

Closed
wants to merge 2 commits into from
Closed

Add async support for DTLS #253

wants to merge 2 commits into from

Conversation

Taowyoo
Copy link
Collaborator

@Taowyoo Taowyoo commented Apr 19, 2023

To keep things simple, the async support for DTLS is implemented by:

  • Added ConnectedAsyncUdpSocket
  • Impl AsyncRead and AsyncWrite for ConnectedAsyncUdpSocket
  • Extend async-session test for testing DTLS

@Taowyoo
Copy link
Collaborator Author

Taowyoo commented Apr 20, 2023

bors cancel

1 similar comment
@Taowyoo
Copy link
Collaborator Author

Taowyoo commented Apr 20, 2023

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)
Copy link
Member

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()
Copy link
Member

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.

@Taowyoo
Copy link
Collaborator Author

Taowyoo commented Oct 19, 2023

This old PR need to rebase on to main because of change of default branch to main.
See more:

@Taowyoo
Copy link
Collaborator Author

Taowyoo commented Dec 11, 2023

Close this, since it's no longer needed.

@Taowyoo Taowyoo closed this Dec 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants