-
Notifications
You must be signed in to change notification settings - Fork 368
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
First feeback about "clean connection API". #1240
Comments
May idea was more a "callback interface", which reports to remove the connection or not. In my opinion that would keep the public API smaller and doesn't expose the connection store just for Currently the return value is used to stop the iteration (
For me this looks like the old "secret" got "published". For that rare case, I would accept the "race" and shutdown the connection in doubts. The device will be able to connect again. This will happen only rarely, so I don't see a real issue there. |
Not really but this it seems to be the behavior expected (see eclipse-leshan/leshan#162) and I can understand that. You remove or change the credential you expect client is not able to connect. (but maybe this is an incorrect expectation)
I'm not so sure about this. As to me ConnectionStore is already exposed:
With some line of code I can access to connectionStore but this is not so easy. |
I would be afraid, that the "serialized execution" will not be obeyed.
Yep. And if someone corrupts the serial execution it will not work. |
Ok I get your point, a solution could be to warn user in documentation about which method MUST be called in the "serialized execution". (In all case this kind of documentation make sense) Another one would be to have access to the store in the callback ? something like :
|
I don't get it! Why should the return value not be used to define, if the connection or what ever should be removed?
Something similar to that example implementation. |
You said we have an enum with NEXT, STOP, DROP It seems to be too strict. |
That was an idea to extend the current mechanism. And the idea could be also more extended. e.g. return logical flags b001 = next/stop b010 = drop connection, b100 drop session ( and the combinations). |
It can but it's hard to me to understand why it seems so important to avoid users to directly use their connection store. |
I begin to use the new DTLSConnector API to remove connections. (
startForEach
,startTerminateConnectionsForPrincipal
, ...)For now, I try to implement an optional feature where connection is removed when Leshan
SecurityInfo
is removed from LeshanSecurityStore
. (Maybe one day, I will really works on connection/session lifetime 😅 ...)If you want to remove connection without using
startDropConnectionsForPrincipal
andstartTerminateConnectionsForPrincipal
there is not easy way because we haven't easy access toconnectionStore
to callconnectionStore.remove(connection)
instartForEach
.Implementing this : I have some concern about a potential race condition. Imagine :
About 2, I'm not sure this is a real case issue, my first idea to avoid that would be to try to only remove "old" connection by checking
DTLSSession.getLastHandshakeTime()
. If this is a good idea maybe this could make sense to also do this check instartTerminateConnectionsForPrincipal
?The text was updated successfully, but these errors were encountered: