Robert-
A couple of questions…
First, in looking at the client code example here:
https://github.com/darconeous/smcp/blob/master/src/plugtest/main-client.c
it appears that while using uIP, and a single instance of struct smcp_state that I’m limited to a single handling a single client request/response at a time – correct ?
So if I have a client application that is making a request and awaiting a response no other requests can be issued until the transaction associated with the response has ‘ended’ ?
I guess that the ‘work-around’ is to spin up a new instance of smcp_state (and outgoing uIP port) for each new request…
Second, it’s not clear to me how the transaction has to be handled when attempting to make a client application ‘observe’ a remote resource.
Thanks for your continued assistance,
First, in looking at the client code example here:it appears that while using uIP, and a single instance of struct smcp_state that I’m limited to a single handling a single client request/response at a time – correct ?So if I have a client application that is making a request and awaiting a response no other requests can be issued until the transaction associated with the response has ‘ended’ ?
Second, it’s not clear to me how the transaction has to be handled when attempting to make a client application ‘observe’ a remote resource.
smcp_status_t
smcp_transaction_end(
smcp_t self,
smcp_transaction_t transaction
) {
SMCP_EMBEDDED_SELF_HOOK;
DEBUG_PRINTF("smcp_transaction_end: %p",transaction);
#if SMCP_CONF_TRANS_ENABLE_OBSERVING
if(transaction->flags&SMCP_TRANSACTION_OBSERVE) {
// If we are an observing transaction, we need to clean up
// first by sending one last request without an observe option.
// TODO: Implement this!
}
#endif
if(transaction == self->current_transaction)
self->current_transaction = NULL;
if(transaction->active) {
transaction->active = 0; // Maybe we should remove this line? May be hiding bad behavior.
#if SMCP_TRANSACTIONS_USE_BTREE
bt_remove(
(void**)&self->transactions,
(void*)transaction,
(bt_compare_func_t)smcp_transaction_compare,
(bt_delete_func_t)smcp_internal_delete_transaction_,
self
);
#else
ll_remove((void**)&self->transactions,(void*)transaction);
smcp_internal_delete_transaction_(transaction,self);
#endif
}
return 0;
}
So I have the multiple requests working, using multiple transactions.
I'm now trying to be able to handle requests that Observe. I believe that I just have to add the COAP_OPTION_OBSERVE to the outbound request and add the SMCP_TRANSACTION_OBSERVE flag when initializing the transaction.
Robert-
First, thank you for your detailed reply. I greatly appreciate your continued support.
I removed the un-necessary COAP_OPTION_OBSERVE from the outbound request and it still appears to work.
And, when I am no longer interested in the observation I end the transaction and SMCP responds to the remote server with a RST – which does stop the server from sending further observations.
For some reason my end is issuing multiple observe requests which results in multiple observations being received – still have to track this down:

Robert-
First, thank you for your detailed reply. I greatly appreciate your continued support.
I removed the un-necessary COAP_OPTION_OBSERVE from the outbound request and it still appears to work.
And, when I am no longer interested in the observation I end the transaction and SMCP responds to the remote server with a RST – which does stop the server from sending further observations.
For some reason my end is issuing multiple observe requests which results in multiple observations being received – still have to track this down:
<image001.png>