-
Notifications
You must be signed in to change notification settings - Fork 408
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
Have DefaultRegistrationEngine try to update reg after start #1579
base: master
Are you sure you want to change the base?
Conversation
- Before this, re-registration would happen on every engine start
(I will look at this next week) |
I looked at this and regarding my comments at #1574 (comment),
I still don't know if this should be added. Pro :
Con :
I adapt some tests to check if it could works with Note that if we wanted to support this feature we should rather add new tests instead of modifying existing one. |
An alternative to this PR : #1574 (comment) |
if (dmServer == null) { | ||
// If it failed try client initiated bootstrap | ||
if (!scheduleClientInitiatedBootstrap(NOW)) | ||
throw new IllegalStateException("Unable to start client : No valid server available!"); | ||
} else { | ||
registerFuture = schedExecutor.submit(new RegistrationTask(dmServer)); | ||
// If there exists a registered server already, we try to send a registration update |
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.
I'd actually be sceptical here. If a client is stopped, it should not keep registrations. So this situation should not be allowed.
If somebody truly needs a LWM2M client that supports this, they can either implement their own registration engine or subclass it.
I am not in favor of doing this.
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.
Thx for taking time to look at this and also for sharing your opinion. 🙏
For now, no plan to integrate this BUT if for some reason we decide to ingrate it this will not be the default behavior.
As discussed in #1574 , some changes are needed in the Default implementation of RegistrationEngine to support the stopping and starting of Leshan client without re-registration happening every time.
Basically the list of registered servers is checked when start-method is called, and registration update is tried.
Note Will still need to at least update the tests if this is deemed merge-worthy.