leshan
leshan copied to clipboard
Experiments some LWM2M over coap+tcp based on californium
This is an experimental work based on #1318 #1323 and #1336 and not mature coap+tcp implementation of californium. (it aims to implement #1047)
I rebase this PR on new cleaner version of abstraction layer (#1318 , #1323)
Sometime I face this kind of exception :
org.eclipse.leshan.core.request.exception.UnconnectedPeerException: Unable to send request coap://127.0.0.1:56124/3/0 : peer is not connected
at org.eclipse.leshan.core.californium.DefaultExceptionTranslator.translate(DefaultExceptionTranslator.java:28)
at org.eclipse.leshan.core.californium.CoapSyncRequestObserver.onSendError(CoapSyncRequestObserver.java:100)
at org.eclipse.californium.core.coap.Message.setSendError(Message.java:1029)
at org.eclipse.californium.core.coap.Request.setSendError(Request.java:1032)
at org.eclipse.californium.core.network.CoapEndpoint$SendingCallback.onError(CoapEndpoint.java:1299)
at org.eclipse.californium.elements.RawData.onError(RawData.java:314)
at org.eclipse.californium.elements.tcp.netty.TcpServerConnector.send(TcpServerConnector.java:200)
at org.eclipse.californium.core.network.CoapEndpoint$OutboxImpl.sendRequest(CoapEndpoint.java:924)
at org.eclipse.californium.core.network.stack.BaseCoapStack$StackBottomAdapter.sendRequest(BaseCoapStack.java:231)
at org.eclipse.californium.core.network.stack.AbstractLayer.sendRequest(AbstractLayer.java:69)
at org.eclipse.californium.core.network.stack.BlockwiseLayer.sendRequest(BlockwiseLayer.java:498)
at org.eclipse.californium.core.network.stack.TcpObserveLayer.sendRequest(TcpObserveLayer.java:57)
at org.eclipse.californium.core.network.stack.AbstractLayer.sendRequest(AbstractLayer.java:69)
at org.eclipse.californium.core.network.stack.TcpExchangeCleanupLayer.sendRequest(TcpExchangeCleanupLayer.java:45)
at org.eclipse.californium.core.network.stack.BaseCoapStack$StackTopAdapter.sendRequest(BaseCoapStack.java:188)
at org.eclipse.californium.core.network.stack.BaseCoapStack.sendRequest(BaseCoapStack.java:87)
at org.eclipse.californium.core.network.CoapEndpoint$3.run(CoapEndpoint.java:701)
at org.eclipse.californium.elements.util.SerialExecutor$1.run(SerialExecutor.java:293)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)
Caused by: org.eclipse.californium.elements.exception.EndpointUnconnectedException: TCP client not connected!
... 15 common frames omitted
I didn't investigate yet.
About UnconnectedPeerException, my investigation at : https://github.com/eclipse-californium/californium/issues/2081
(The UnconnectedPeerException issue should be "fixed" in last commit in an acceptable way for an experimental feature : https://github.com/eclipse-californium/californium/issues/2081#issuecomment-1305828081)
At least at short/mid term, there will not be more work on this (see https://github.com/eclipse/leshan/issues/1047#issuecomment-1436736008)
But we can keep the PR in case, one day someone succeed to add coap+tcp to Californium.