public Services.P2PCommunicationsScheme.Data.P2PData RetrieveData(Services.P2PCommunicationsScheme.Data.P2PDataRequest request, int P2PPortNumber) { if (request.RequestedDataName == CNDServiceDefinitions.CND_TABLE_DATA_NAME) { P2PData cndTable = new P2PData(CNDServiceDefinitions.CND_TABLE_DATA_NAME, this.CNDTable.DataTable); return(cndTable); //***************************************************************** // !!!!! IMPORTANT EVALUATION //this indicates to the connected client that the port belongs to //the CND service, //***************************************************************** } else if (request.RequestedDataName == CNDServiceDefinitions.CND_SERVICE_PORT_CONNECTION_CHECK_DATA) { return(new P2PData(CNDServiceDefinitions.CND_SERVICE_PORT_CONNECTION_CHECK_DATA, true)); //***************************************************************** //***************************************************************** } else if (request.RequestedDataName == CNDServiceDefinitions.CND_GET_COMPONENT_CND_REGISTRY_CMD) { return(this.Handle_GetComponentAddressingRegistry_Request(request)); } else { throw (new Exception("The CND Service can handle the data named \'" + request.RequestedDataName + "\'")); } }
public Services.P2PCommunicationsScheme.Data.P2PData RetrieveData(Services.P2PCommunicationsScheme.Data.P2PDataRequest request, int P2PPortNumber) { string adresseComponentName = System.Convert.ToString(request.GetRequestParameter("ADDRESSE_COMPONENT")); if (adresseComponentName == null) { throw (new Exception("Can\'t retrieve data because the parameter \'ADDRESSE_COMPONENT\' was missing in the request structure")); } string senderComponentName = System.Convert.ToString(request.GetRequestParameter("SENDER_COMPONENT")); if (senderComponentName == null) { throw (new Exception("Can\'t retrieve data because the parameter \'SENDER_COMPONENT\' was missing in the request structure")); } CNDCommunicationsEnvironment.Data.CommunicationsDataRequest commdDataRequest = new CNDCommunicationsEnvironment.Data.CommunicationsDataRequest(adresseComponentName, senderComponentName, System.Convert.ToString(request.RequestedDataName)); CommunicationsData dataResult = ((CNDCommunicationsEnvironment.Interfaces.IUseCNDCommunicationsScheme) this._componentOwner).RetrieveDataToRemoteComponent(commdDataRequest); P2PData resultData = P2PData.GetP2PDataObject(dataResult.P2PData.DataName, dataResult.P2PData.Value); return(resultData); }