/// <summary> /// This action is used to send SEGMENT_INFO_MESSAGE request to and receive the /// correspondent Response Message from the hosted cache server. /// </summary> /// <param name="paddingInMessageHeader">An array formed by bytes for message header padding</param> /// <param name="pccrrPort">The port on which MS-PCCRR server-role will be listening. </param> /// <param name="paddingInConnectionInformation">An array formed by bytes for connection information padding</param> /// <param name="segmentInformation">The segment information.</param> /// <returns>Return the response message of the SegmentInfoMessage</returns> public ResponseMessage SendSegmentInfoMessage( byte[] paddingInMessageHeader, int pccrrPort, byte[] paddingInConnectionInformation, SegmentInformation segmentInformation) { // Convert the struct segmentInformation in adapter to the format in stack Content_Information_Data_Structure segmentInformationStack = ServerHelper.ConvertTostackForContentInfo(segmentInformation); // Create the SEGMENT_INFO_MESSAGE struct defined in stack for SendSegmentInfoMessage method SEGMENT_INFO_MESSAGE segmentInfoMessage = this.pchcClient.CreateSegmentInfoMessage( pccrrPort, segmentInformationStack); segmentInfoMessage.MsgHeader.Padding = paddingInMessageHeader; segmentInfoMessage.ConnectionInfo.Padding = paddingInConnectionInformation; this.ValidateSegmentInfoMessage(segmentInfoMessage); try { RESPONSE_MESSAGE responseMessageStack = this.pchcClient.SendSegmentInfoMessage(segmentInfoMessage); ResponseMessage responseMessage = ServerHelper.ConvertFromStackForResponseMsg(responseMessageStack); this.ValidateSegmentInfoResponse(responseMessage); return(responseMessage); } catch (NoRESPONSEMESSAGEException) { throw new NoResponseMessageException(); } }
/// <summary> /// This action is used to send SEGMENT_INFO_MESSAGE request to and receive the /// correspondent Response Message from the hosted cache server. /// </summary> /// <param name="paddingInMessageHeader">An array formed by bytes for message header padding</param> /// <param name="pccrrPort">The port on which MS-PCCRR server-role will be listening. </param> /// <param name="paddingInConnectionInformation">An array formed by bytes for connection information padding</param> /// <param name="segmentInformation">The segment information.</param> /// <returns>Return the response message of the SegmentInfoMessage</returns> public ResponseMessage SendSegmentInfoMessage( byte[] paddingInMessageHeader, int pccrrPort, byte[] paddingInConnectionInformation, SegmentInformation segmentInformation) { // Convert the struct segmentInformation in adapter to the format in stack Content_Information_Data_Structure segmentInformationStack = ServerHelper.ConvertTostackForContentInfo(segmentInformation); // Create the SEGMENT_INFO_MESSAGE struct defined in stack for SendSegmentInfoMessage method SEGMENT_INFO_MESSAGE segmentInfoMessage = this.pchcClient.CreateSegmentInfoMessage( pccrrPort, segmentInformationStack); segmentInfoMessage.MsgHeader.Padding = paddingInMessageHeader; segmentInfoMessage.ConnectionInfo.Padding = paddingInConnectionInformation; this.ValidateSegmentInfoMessage(segmentInfoMessage); try { RESPONSE_MESSAGE responseMessageStack = this.pchcClient.SendSegmentInfoMessage(segmentInfoMessage); ResponseMessage responseMessage = ServerHelper.ConvertFromStackForResponseMsg(responseMessageStack); this.ValidateSegmentInfoResponse(responseMessage); return responseMessage; } catch (NoRESPONSEMESSAGEException) { throw new NoResponseMessageException(); } }