Comments (11)
The question is maybe why someone would like to handle response timeout on its own ?
I don't know if there is good reason. 🤔
In my case, this is maybe a not so good reason... I already implement it and when I integrated v6.12.0 and I wanted to go back to previous behavior without going deeper in this new feature.
Maybe instead I should use the new feature correctly.
Here some question to be sure it match my needs :
- This
responseTimeout
can be set at CoapServer level but also at CoapRequest level usingRESPONSE_TIMEOUT
in Transport Context ? - How does is work with BlockTransfer ?
- Is there a way to know if this is a ResponseTimeout or a CoAP Reliability Timeout ? I think both failed in a same way raising a
CoapTimeoutException
?
from java-coap.
Not directly linked but reading the code, I see that there is also a responseTimeout for notificaiton :
Service<SeparateResponse, Boolean> sendNotification = new NotificationValidator()
.andThen(new BlockWiseNotificationFilter(capabilities()))
.andThen(new ResponseTimeoutFilter<>(timer, req -> req.getTransContext().getOrDefault(RESPONSE_TIMEOUT, responseTimeout)))
.andThen(Filter.of(CoapPacket::from, CoapPacket::isAck))
.andThenMap(midSupplier::update)
.andThen(retransmissionFilter)
.andThen(piggybackedExchangeFilter)
.then(sender);
Not sure to get the meaning of this ? 🤔
from java-coap.
I assume that by saying 'mandatory' you mean it always have some value, and if not specified in CoapServerBuilder it will use default value (2 minutes).
It's purpose is to timeout:
- NON confirmable transactions
- Transaction with separate response.
- Any block transfers
Are you suggesting that there are use cases where there is no need to have a timeout guard for some transactions?
- This
responseTimeout
can be set at CoapServer level but also at CoapRequest level usingRESPONSE_TIMEOUT
in Transport Context ?
That's true. Setting it in CoapRequest will overwrite CoapServer one.
- How does is work with BlockTransfer ?
Timer starts on first block and is not restarted on each block.
- Is there a way to know if this is a ResponseTimeout or a CoAP Reliability Timeout ? I think both failed in a same way raising a
CoapTimeoutException
?
That's true. We could easily add cause for timeout exception if you see a need.
from java-coap.
Not directly linked but reading the code, I see that there is also a responseTimeout for notificaiton :
It is used to timeout outgoing observations.
from java-coap.
I assume that by saying 'mandatory' you mean it always have some value, and if not specified in CoapServerBuilder it will use default value (2 minutes)
Yep, that what I meant
from java-coap.
Are you suggesting that there are use cases where there is no need to have a timeout guard for some transactions?
Not really, I was more thinking about cases where java-coap
user implements its own way to handle coap response timeout. (which is my case for now).
For me, maybe it's better to consider to reuse coap response timeout from java-coap (let's see if this is possible)
In a more general perspective, I guess being able to deactivate could make sense but I haven't strong argument (as maybe for me there is another way)
from java-coap.
That's true. Setting it in CoapRequest will overwrite CoapServer one.
Timer starts on first block and is not restarted on each block.
That sounds good to me.
That's true. We could easily add cause for timeout exception if you see a need.
To have exactly same behavior than what I have currently I need something like this.
from java-coap.
It is used to timeout outgoing observations.
I'm not sure I get it.
This is about sending Notification right ?
But a notification is either a CON or a NON ?
For NON there is nothing to timeout ?
For CON no need to response timeout as there is reliability timeout out (based on ACK + retransmission)
Or maybe this is about Notification with blockwise ?
from java-coap.
Yes, you're right, for sending notifications there is no use of it. Not even for blockwise transfer as we only notify first block and the rest has to be requested by recipient (so it's separate transaction).
In general, in your use case maybe better to set it to something big and handle timeouts in leshan. Just remember to call cancel on response's CompletableFuture.
from java-coap.
Reopen if you think there is still something more to discuss.
from java-coap.
In general, in your use case maybe better to set it to something big and handle timeouts in leshan. Just remember to call cancel on response's CompletableFuture.
I do not like so much the idea about having big value instead of deactivating but I can live with it for now.
(I may come back to you on this later when I will be in a more polishing phase)
Thx for you help 🙏
from java-coap.
Related Issues (20)
- General discussion / feedback from Leshan Team HOT 49
- Being able to check if a message (request/response) is a CON ? HOT 4
- Shared 'observe relation' store at CoAP client side. HOT 6
- Add support of Option without value in Uri-Query. HOT 5
- NPE in Deduplicator HOT 3
- Add a way to configure ACK_RANDOM_FACTOR for retransmission. HOT 3
- We should be able to add `/` and `/*` to `RouterService` HOT 5
- Using Semantic Versioning to manage API changes ? HOT 1
- Feedback about new API for CoAP Observe. HOT 34
- RFC9175 Request-Tag and Echo Option HOT 28
- General questions about coap+tcp usage ? HOT 7
- Copy/paste typo in `SingleConnectionSocketServerTransport` ? HOT 2
- Question about cancelling observe with `coap+tcp` ?
- New CoapRequest / CoapResponse Builder API feedback HOT 4
- Notification without observe option HOT 3
- PSK and RPK support using `coap+tcp` HOT 8
- Missing API in Transport Context HOT 1
- Introduce a CoapMessage class/interface ? HOT 4
- Missing peer identity/transport context checks ? HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from java-coap.