-
Notifications
You must be signed in to change notification settings - Fork 160
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
Perform handshake on first read/write #649
Conversation
PR looks beautiful to me! Matches Upstream and fixes biggest issue with lib at the moment :) |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #649 +/- ##
==========================================
- Coverage 80.19% 80.08% -0.11%
==========================================
Files 101 101
Lines 5336 5313 -23
==========================================
- Hits 4279 4255 -24
- Misses 687 689 +2
+ Partials 370 369 -1
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
76eb05f
to
d4b2f07
Compare
CipherSuites: []dtls.CipherSuiteID{dtls.TLS_PSK_WITH_AES_128_CCM_8}, | ||
ExtendedMasterSecret: dtls.RequireExtendedMasterSecret, | ||
// Create timeout context for accepted connection. | ||
ConnectContextMaker: func() (context.Context, func()) { |
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.
Is it easy/possible to do 30 second timeout still with new APIs?
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.
Yes, you would essentially call conn.HandshakeContext(<30 second timeout context>)
manually before the first read/write. In other words, the sequence of calls would be something like:
for {
conn := lis.Accept()
go func() {
if err := conn.Handshake(<30 second timeout context>); err != nil {
...
}
// regular read/write stuff
}()
}
Damn @kevmo314 really exceptional PR, I am so grateful for your help. If you are in support I say we delete/break as much as we can now. Since we are doing a major release try to go with zero baggage. Also would be nice to have zero functionally change in examples. Users can reference them when updating their code. |
Sounds good, I'll update them to include the timeout context. |
d4b2f07
to
f99cd6a
Compare
Updates the connection to perform a handshake on first read/write instead of on accept. Closes #279.
f99cd6a
to
3e504d0
Compare
Description
Updates the connection to perform a handshake on first read/write instead of on accept.
Reference issue
#279