Creates a new CoAP client to the provided endpoint address
Constructs a new CoAP client to the provided endpoint address and port.
Stops this client
Given the builder this will extract the details required to encode the CoAP packet into its byte form, register a coap request internally and return a future for this request.
Creates a new CoAP request builder
The intention of this method is that some kind-of CoapMessagingLayer can call this when it has no new messages to process.
Sets the exchange lifetime. In other words the duration of time that must pass before a message ID is considered free-for-use again
Given a packet this will try and find an active request with a matching token and return it.
Tests the client
In the future dogfooding should be used and we should test against our own server too.
// Address[] resolved = getAddress("coap.me"); // resolved[0].po Address addr = new InternetAddress("coap.me", 5683); // CoapClient client = new CoapClient(addr); // client.resource("/hello"); // client.connect(); // Test sending something CoapPacket packet = new CoapPacket(); packet.setCode(Code.POST); packet.setToken([69]); packet.setPayload(cast(ubyte[])"My custom payload"); packet.setType(MessageType.CONFIRMABLE); packet.setMessageId(257); // client.socket.send(packet.getBytes());
A CoAP client