Comments (5)
So far there is no support for transferring streams of data in Californium. You can either read in all data into memory and let Californium do the chunking or you need to implement the chunking yourself, which you seem to have opted for.
However, since I am not very knowledgable about the blockwise code in Californium this should probably be answered by @mkovatsc
from californium.
Thank you,
I've done chunking by myself but it ends with aforementioned NPE in BlockwiseLayer (on receiving response)
from californium.
The original idea was to leave out the BlockwiseLayer, when you want to handle Blockwise Transfers manually. However, the stack wasn't tested in such a configuration recently. Maybe you can give it a try and tell us what happens...
I also explained another possible strategy here https://dev.eclipse.org/mhonarc/lists/cf-dev/msg00654.html:
If someone needs to mix resources with "normal blockwise transfers" and streaming resources, one could implement a flag that let's BlockwiseLayer pass all messages untouched, so that the resource handler can implement block handling.
from californium.
Please advise if this is a way to turn off BlockWiseLayer
$ git diff californium-core/src/main/java/org/eclipse/californium/core/network/stack/CoapStack.java
diff --git a/californium-core/src/main/java/org/eclipse/californium/core/network/stack/CoapStack.java b/californium-core/src/main/java/org/ecli
index 13658e1..6bfab37 100644
--- a/californium-core/src/main/java/org/eclipse/californium/core/network/stack/CoapStack.java
+++ b/californium-core/src/main/java/org/eclipse/californium/core/network/stack/CoapStack.java
@@ -105,7 +105,7 @@ public class CoapStack {
new Layer.TopDownBuilder()
.add(top)
.add(new ObserveLayer(config))
-
.add(new BlockwiseLayer(config))
-
//.add(new BlockwiseLayer(config)) .add(reliabilityLayer) .add(bottom = new StackBottomAdapter()) .create();
$git diff californium-core/src/main/java/org/eclipse/californium/core/network/Matcher.java
diff --git a/californium-core/src/main/java/org/eclipse/californium/core/network/Matcher.java b/californium-core/src/main/java/org/eclipse/cali
index 44dfe9b..618c091 100644
--- a/californium-core/src/main/java/org/eclipse/californium/core/network/Matcher.java
+++ b/californium-core/src/main/java/org/eclipse/californium/core/network/Matcher.java
@@ -517,7 +517,7 @@ public class Matcher {
}
Request request = exchange.getCurrentRequest();
-
if (request != null && (request.getOptions().hasBlock1() || response.getOptions().hasBlock2()) ) {
-
if (request != null && response != null && (request.getOptions().hasBlock1() || response.getOptions().hasBlock2 KeyUri uriKey = new KeyUri(request.getURI(), request.getSource().getAddress(), request.getSourcePort()) LOGGER.log(Level.FINE, "Remote ongoing completed, cleaning up ", uriKey); ongoingExchanges.remove(uriKey);
BTW, "response != null" check is needed. Otherwise, it'll crash.
from californium.
we are trying to close out outstanding issues for the next release. We have put a lot of work into the BlockwiseLayer
on the 2.0.x branch. FMPOV it should be possible to do a manual blockwise transfer based on this work (using either master or 2.0.x). This work will not find its way into the 1.0.x branch though. I strongly advise to update to 2.0.x in order to take advantage of all other improvements we have been working on as well.
Closing this as won't fix.
from californium.
Related Issues (20)
- Dealing with RESPONSE_MATCHING parameter on device (reverse engineering) HOT 2
- Minor Release 3.9.0 - Available HOT 11
- Why do DTLS_CONNECTOR_THREAD_COUNT and DTLS_RECEIVER_THREAD_COUNT default to 1? HOT 1
- IllegalStateException: automatic message IDs exhausted HOT 9
- FETCH and blockwise - Behavior change of Californium 3.8
- I have a question about simple file server HOT 15
- DatagramFilterExtended#onDrop called with not "full" Record HOT 5
- I used californium for Android 11, and there is some mistakes, and I don't understand why? HOT 5
- CoAP Request-Tag option Support HOT 2
- Add Sequence Token Generator ? HOT 3
- CoAP Echo option Support HOT 3
- Bugfix Release 3.9.1 - Available HOT 1
- I wanna save the whole logs of SenML JSON. HOT 7
- Demo certificates renewed
- Request response metrics - Experience using Azure Insights and Californium HOT 8
- Runtime dependency - logback 1.2 - CVE-2023-6378 fix available HOT 10
- Minor Release 3.10.0 - Available HOT 1
- Handshake with [x.x.x.x:xxxx] failed after session was established! Alert Protocol Level: FATAL Description: HANDSHAKE_FAILURE HOT 17
- Californium Deployment issues HOT 12
- ignoring ACK, possible MID reuse before lifetime end for token HOT 4
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 californium.