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

core: dont close connection when it is currently used #269

Merged
merged 2 commits into from
Jun 21, 2022

Conversation

jkralik
Copy link
Member

@jkralik jkralik commented Jun 21, 2022

No description provided.

@jkralik jkralik requested a review from Danielius1922 June 21, 2022 14:11
@@ -48,6 +50,63 @@ type TLSConfig struct {
GetCertificateAuthorities GetCertificateAuthoritiesFunc
}

type conn struct {
mutex *semaphore.Weighted
c atomic.Value // *coap.ClientCloseHandler
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it's a bit unusual to have both an atomic variable and a synchronization primitive

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mainly it is used for synchronize dial and remove call. Only one dial can be called to one endpoint. And if dial is progress then remove function do nothing.

@jkralik jkralik merged commit 92f9d57 into main Jun 21, 2022
@jkralik jkralik deleted the jkralik/fix/parallelRequest branch June 21, 2022 15:54
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