Added runtime checks for server and client

This commit is contained in:
Pavel Kirienko
2014-03-14 11:33:37 +04:00
parent 0f1b124086
commit 8889a52e63
2 changed files with 4 additions and 2 deletions
+3 -2
View File
@@ -88,13 +88,14 @@ private:
handleFatalError("Invalid caller callback");
}
void handleReceivedDataStruct(ReceivedDataStructure<ResponseType>& request)
void handleReceivedDataStruct(ReceivedDataStructure<ResponseType>& response)
{
assert(response.getTransferType() == TransferTypeServiceResponse);
const TransferListenerType* const listener = SubscriberType::getTransferListener();
if (listener)
{
const typename TransferListenerType::ExpectedResponseParams erp = listener->getExpectedResponseParams();
ServiceCallResultType result(ServiceCallResultType::Success, erp.src_node_id, request);
ServiceCallResultType result(ServiceCallResultType::Success, erp.src_node_id, response);
cancel();
invokeCallback(result);
}
@@ -38,6 +38,7 @@ private:
void handleReceivedDataStruct(ReceivedDataStructure<RequestType>& request)
{
assert(request.getTransferType() == TransferTypeServiceRequest);
if (try_implicit_cast<bool>(callback_, true))
{
response_ = ResponseType(); // The application needs newly initialized structure