qthighway/xqservice/src/xqservicerequest.cpp
changeset 8 71781823f776
parent 4 90517678cc4f
child 19 46686fb6258c
equal deleted inserted replaced
5:453da2cfceef 8:71781823f776
    75     QString m_Message;
    75     QString m_Message;
    76     bool m_Synchronous;
    76     bool m_Synchronous;
    77     XQServiceRequest* m_Parent;
    77     XQServiceRequest* m_Parent;
    78     XQRequestUtil m_RequestUtil;
    78     XQRequestUtil m_RequestUtil;
    79     XQServiceManager* serviceManager;
    79     XQServiceManager* serviceManager;
    80 
    80     QString m_uniqueChannelName;
    81     
    81     
    82 };
    82 };
    83 
    83 
    84 XQServiceRequest_Private::~XQServiceRequest_Private()
    84 XQServiceRequest_Private::~XQServiceRequest_Private()
    85 {
    85 {
   170   Destructs the service request. Unlike QtopiaIpcEnvelope, the
   170   Destructs the service request. Unlike QtopiaIpcEnvelope, the
   171   request is not automatically sent.
   171   request is not automatically sent.
   172 */
   172 */
   173 XQServiceRequest::~XQServiceRequest()
   173 XQServiceRequest::~XQServiceRequest()
   174 {
   174 {
   175     XQSERVICE_DEBUG_PRINT("XQServiceRequest::~XQServiceRequest=");
   175     XQSERVICE_DEBUG_PRINT("XQServiceRequest::~XQServiceRequest %s", qPrintable(m_data->m_uniqueChannelName));
   176     XQServiceAdaptor::cancelPendingSend(m_data->m_Service);
   176     XQServiceAdaptor::cancelPendingSend(m_data->m_uniqueChannelName);
   177     delete m_data;
   177     delete m_data;
   178 }
   178 }
   179 
   179 
   180 /*!
   180 /*!
   181   Returns true if either the service() or message() is not set.
   181   Returns true if either the service() or message() is not set.
   245     // !!!
   245     // !!!
   246     // Add the info as extra argument to the request
   246     // Add the info as extra argument to the request
   247     // This shall be removed by the server
   247     // This shall be removed by the server
   248     // !!!
   248     // !!!
   249     addArg(qVariantFromValue(m_data->m_RequestUtil.mInfo));
   249     addArg(qVariantFromValue(m_data->m_RequestUtil.mInfo));
   250 
   250        
   251     XQSERVICE_DEBUG_PRINT("XQServiceRequest::send(2):mDescriptor");
       
   252         
       
   253     // Pass always the util instance onwards as user data.
   251     // Pass always the util instance onwards as user data.
   254     // It can be utilized by the XQServiceManager::startServer
   252     // It can be utilized by the XQServiceManager::startServer
   255     // e.g. to optimize startup of a service server
   253     // e.g. to optimize startup of a service server
   256     return XQServiceAdaptor::send(m_data->m_Service,  message(), m_data->m_arguments, retData, m_data->m_Synchronous,m_data,
   254 
       
   255     // Create unique channel name to separate multiple client requests to same channel name.
       
   256     quint32 handle = (unsigned int)m_data;
       
   257     m_data->m_uniqueChannelName = QString("%1:").arg(handle) + m_data->m_Service;
       
   258     XQSERVICE_DEBUG_PRINT("XQServiceRequest::send(2):uniqueChannel=%s", qPrintable(m_data->m_uniqueChannelName));
       
   259     return XQServiceAdaptor::send(m_data->m_uniqueChannelName,  message(), m_data->m_arguments, retData, m_data->m_Synchronous,m_data,
   257                                  (const void *)&m_data->m_RequestUtil);
   260                                  (const void *)&m_data->m_RequestUtil);
   258 }
   261 }
   259 /*!
   262 /*!
   260   Sets the \a service to which the request will be sent.
   263   Sets the \a service to which the request will be sent.
   261 
   264