ret=blade_session_send(bs,req,blade_protocol_publish_response_handler);// @todo add another callback to parameters so caller can be informed of blade.publish response
// @todo upon return, a provider should register the methods for this protocol to be locally available
// prior to receiving a response, if the response is an error then unregister, but if it is successful
// then the node is already primed to receive any immediate requests
ret=blade_session_send(bs,req,blade_protocol_locate_response_handler);// @todo add another callback to parameters so caller can be informed of blade.publish response
// @todo upon return, a provider should register the methods for this protocol to be locally available
// prior to receiving a response, if the response is an error then unregister, but if it is successful
// then the node is already primed to receive any immediate requests
cJSON_AddStringToObject(res_error,"responder-nodeid",req_params_responder_nodeid);// @todo responder-nodeid should become the local_nodeid to inform of which node actually responded
blade_session_send(bs,res,NULL);
gotodone;
}
// @todo this creates a new request that is tracked locally, in order to receive the response in a callback to route it correctly, this could be simplified
// by using a couple special fields to indicate common routing approaches based on a routing block in common for every message, thus being able to bypass this
// and still be able to properly route responses without a specific response handler on every intermediate router, in which case messages that are only being
// routed would not enter into these handlers and would not leave a footprint passing through routers
ks_log(KS_LOG_DEBUG,"Session (%s) locate request (%s to %s) routing upstream (%s)\n",blade_session_id_get(bs),req_params_requester_nodeid,req_params_responder_nodeid,blade_session_id_get(bsu));
// request was just received on a session that is already read locked, so we can assume the response goes back on the same session without further lookup
@@ -110,7 +112,7 @@ int main(int argc, char **argv)
blade_identity_destroy(&target);
ks_sleep_ms(5000);
ks_sleep_ms(5000);// @todo use session state change callback to know when the session is ready, this ensures it's ready before trying to publish upstream