diff --git a/zeus/Buffer_addParameter.cpp b/zeus/Buffer_addParameter.cpp index 8e0f67b..a83fdb3 100644 --- a/zeus/Buffer_addParameter.cpp +++ b/zeus/Buffer_addParameter.cpp @@ -296,7 +296,7 @@ void zeus::Buffer::internalAddParameter(uint16_t _paramId, const bool& _va } m_parameter.push_back(std::make_pair(2,data)); } -#define ZEUS_MINIMUM_SIZE_MULTIPLE (1024*40) +#define ZEUS_MINIMUM_SIZE_MULTIPLE (1024*50) namespace zeus { class SendData { diff --git a/zeus/GateWayClient.cpp b/zeus/GateWayClient.cpp index ecdd743..c1ec3f1 100644 --- a/zeus/GateWayClient.cpp +++ b/zeus/GateWayClient.cpp @@ -76,6 +76,33 @@ void zeus::GateWayClient::onClientData(const ememory::SharedPtr& _ answerProtocolError(transactionId, "missing parameter: 'id'"); return; } + if (_value->getType() == zeus::Buffer::typeMessage::data) { + // TRANSMIT DATA ... + if (m_state != zeus::GateWayClient::state::clientIdentify) { + answerProtocolError(transactionId, "Not identify to send 'data' buffer (multiple packet element)"); + return; + } + uint32_t serviceId = _value->getServiceId(); + if (serviceId == 0) { + answerProtocolError(transactionId, "Can not send multiple data on the gateway"); + return; + } + serviceId--; + if (serviceId >= m_listConnectedService.size()) { + m_interfaceClient.answerError(transactionId, "NOT-CONNECTED-SERVICE"); + return; + } + if (m_listConnectedService[serviceId] == nullptr) { + // TODO ... + ZEUS_ERROR("TODO : Manage this case ..."); + return; + } + m_listConnectedService[serviceId]->m_interfaceClient.callForwardMultiple( + m_uid, + _value, + (uint64_t(m_uid) << 32) + uint64_t(transactionId)); + return; + } if (_value->getType() != zeus::Buffer::typeMessage::call) { ZEUS_ERROR("Protocol error ==>missing 'call'"); answerProtocolError(transactionId, "missing parameter: 'call' / wrong type 'call'"); @@ -294,14 +321,6 @@ void zeus::GateWayClient::onClientData(const ememory::SharedPtr& _ ZEUS_ERROR("TODO : Manage this case ..."); return; } - uint16_t partId = _value->getPartId(); - if (partId != 0) { - m_listConnectedService[serviceId]->m_interfaceClient.callForwardMultiple( - m_uid, - _value, - (uint64_t(m_uid) << 32) + uint64_t(transactionId)); - return; - } m_listConnectedService[serviceId]->m_interfaceClient.callForward( m_uid, _value,