Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Californium (Cf) CoAP Framework » client.put not working observe method(client.observe(new CoapHandler() { @Override onload monitor.put() not working.)
client.put not working observe method [message #1754156] Tue, 14 February 2017 19:23
jay weinstein is currently offline jay weinsteinFriend
Messages: 1
Registered: February 2017
Junior Member
Hi,

I have created a resouce on localhost and a observe method to receive any updates to the resource. This seems to be working correctly in onLoad. However, when I try to send a message in onLoad to a resource at another ip address the put fails.

client.observe(
new CoapHandler() {
@Override
public void onLoad(CoapResponse response) {
final String content = response.getResponseText();
CoapClient monitor = new CoapClient("coap://192.168.0.100:5683/DB");
CoapResponse resp = monitor.put(content, MediaTypeRegistry.TEXT_PLAIN);
if (resp != null)
System.out.println(resp.getResponseText());
else
System.out.println("monitor.put() timeout!!");
}
);

If I print out content I know I'm getting the correct response from the resource. However, monitor.put() fails. The local host address is 192.168.0.101.
Previous Topic:cannot capture coap packets using rawcap
Next Topic:Need General tutorial on setting up DTLS certificates and stores
Goto Forum:
  


Current Time: Wed Apr 24 17:52:26 GMT 2024

Powered by FUDForum. Page generated in 0.02981 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top