CoapRequestFuture

This is returned to the user when he does a finalizing call on a CoapRequestBuilder such as calling post(). The client will then creating the underlying request such that the messaging layer can match a future response to it. The client then sends the CoAP packet and then returns this so-called "future" as a handle to it which can be waited on via a call to get().

Constructors

this
this()

Constructs a new CoapRequestFuture

Members

Functions

cancel
void cancel()

Cancels this future such that all calls to get() will unblock and throw an exception

get
CoapPacket get()

Blocks until the response is received

get
CoapPacket get(Duration timeout)

Blocks until the response is received but will unbllock if the timeout given is exceeded

getState
RequestState getState()

Returns the state of this future

receiveWake
void receiveWake(CoapPacket response)

Called when a matching (by token) CoAP packet is received. This will store the received response and also wake up anyone blocking on the get() call to this future.

Meta