eclipse-californium / californium

CoAP/DTLS Java Implementation
https://www.eclipse.org/californium/
Other
722 stars 364 forks source link

Why Californium auto send Observe to Server? #670

Closed JavaProgrammerLB closed 6 years ago

JavaProgrammerLB commented 6 years ago

About every 1 min, my client sent 17 bytes Observe request to server, I want to know why this auto send happen and how can I stop the auto request?

I use 2.0.0-M6 with dependency below

<dependency>
    <groupId>org.eclipse.californium</groupId>
    <artifactId>californium-core</artifactId>
    <version>2.0.0-M6</version>
</dependency>

My client log: log

Tcpdump packages: image

TcpDump files: filter condition: udp.port==3019 || udp.port == 19406 devicebus-nbiot-access.zip

boaks commented 6 years ago

That's specified in

https://tools.ietf.org/html/rfc7641#section-3.3.1

It takes the value of the MaxAge option as time for the reregistration (that's what you have seen) , and the default in absent of that option is 60 seconds.

See https://tools.ietf.org/html/rfc7252#section-5.10.5 for the specification of the MaxAge option.

JavaProgrammerLB commented 6 years ago

@boaks Thanks for your detailed explanation