Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[leshan-dev] Use registration Endpoint URI in Client object

Hi,

I have been playing around with the LeshanDemoServer during the last weeks and
had some problems figuring out how to configure it with Californium Endpoints
managed by my client code, i.e. not implicitly created by LeshanServerBuilder.

In the course of figuring out what would need to be changed I stumbled across the
fact that we keep references to the "nonSecureEndpoint" and the "secureEndpoint"
all over the place. My understanding was that we do this mostly in order to be
able to determine, whether a request uses a secured endpoint or not. I think that
this is not very elegant and it also limits us to use one non-secure and one
secure endpoint. But what if we want to use a secure endpoint for coap and one
for coap+tcp?

On Californium's 2.0.x branch I have therefore added a getUri() method to the
Endpoint interface which can be used to determine both the protocol the Endpoint
supports as well as the socket address it listens on. Based on this I have made a
small change to leshan's Client class to now keep the registration Endpoint's URI
instead of merely the socket address. This, however, also required some small
changes in some other dependent classes as well.

I have pushed the "improve_builder" branch to the leshan repo containing these
changes as well as a change to LeshanServerBuilder allowing client code to
provide a set of arbitrary Endpoints to be used when building the LeshanServer.

Do these changes pose a problem to you guys? In particular the change to Client
might have an impact on a custom (persistent) implementation of ClientRegistry, I
guess ...

I would otherwise like to create an M3 milestone of Californium 2.0.x in order to
be able to create a PR ...

-- 
Mit freundlichen Grüßen / Best regards

Kai Hudalla
Chief Software Architect

Bosch Software Innovations GmbH
Schöneberger Ufer 89-91
10785 Berlin
GERMANY
www.bosch-si.com

Registered office: Berlin, Register court: Amtsgericht Charlottenburg,
HRB 148411 B;
Executives: Dr.-Ing. Rainer Kallenbach, Michael Hahn

Back to the top