简体   繁体   English

如何设置监听响应的Coap Observer

[英]How set a Coap Observer that listen for response

I'm working with californium library to use Coap protocol in my eclipse project. 我正在使用californium库在我的Eclipse项目中使用Coap协议。 I have sent a request to a server Coap. 我已将请求发送到服务器Coap。 Now i have set on this server a different end point to give response. 现在,我在此服务器上设置了一个不同的端点来做出响应。 How can i implement an observer that listen and wait to receive this response ? 我该如何实现一个监听并等待接收此响应的观察者?

The response to an observe request must always come from the same endpoint as the request was sent to. 对观察请求的响应必须始终来自与发送请求相同的端点。 A message from a different endpoint on that server (that is, from a different IP address or from a different port) would not be recognized by the client. 客户端将无法识别来自该服务器上不同终结点(即来自不同IP地址或来自不同端口)的消息。

I'm pretty unsure, If I understand your question. 我不太确定,如果我理解您的问题。

how can i implement a listener for response ? 如何实现监听器以进行响应?

On the server side? 在服务器端? To prepare the response? 准备回应?

Then the intention is to override CoapResource.handleGET. 然后的目的是覆盖CoapResource.handleGET。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM