client.put not working observe method [message #1754156] |
Tue, 14 February 2017 19:23 |
jay weinstein 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.
|
|
|
Powered by
FUDForum. Page generated in 0.02981 seconds