/// <summary> /// Close channel by channel ID /// </summary> /// <param name="timeout">Time span for waiting</param> /// <param name="channelId"> channel id to specify the channel to be closed</param> public void CloseChannel(TimeSpan timeout, ushort channelId) { if (rdpedycClientStack == null) { throw new InvalidOperationException("RDPEDYC Client is required to be created before close channel!"); } rdpedycClientStack.CloseChannel(channelId); }
private void CheckSupportedProtocols() { // Notify the UI for detecting protocol supported finished DetectorUtil.WriteLog("Check specified protocols support..."); bool serverSupportUDPFECR = false; bool serverSupportUDPFECL = false; if (connectResponsePdu.mcsCrsp.gccPdu.serverMultitransportChannelData != null) { if (connectResponsePdu.mcsCrsp.gccPdu.serverMultitransportChannelData.flags.HasFlag(MULTITRANSPORT_TYPE_FLAGS.TRANSPORTTYPE_UDPFECR)) { serverSupportUDPFECR = true; } if (connectResponsePdu.mcsCrsp.gccPdu.serverMultitransportChannelData.flags.HasFlag(MULTITRANSPORT_TYPE_FLAGS.TRANSPORTTYPE_UDPFECL)) { serverSupportUDPFECL = true; } } detectInfo.IsSupportRDPEMT = serverSupportUDPFECR || serverSupportUDPFECL; if (detectInfo.IsSupportRDPEMT) { DetectorUtil.WriteLog("Detect RDPEMT supported"); } else { DetectorUtil.WriteLog("Detect RDPEMT unsupported"); } rdpedycClient = new RdpedycClient(rdpbcgrClient, rdpbcgrClient.Context, false); try { DynamicVirtualChannel channel = rdpedycClient.ExpectChannel(timeout, DYVNAME_RDPEDYC, DynamicVC_TransportType.RDP_TCP); if (channel != null) { detectInfo.IsSupportRDPEDYC = true; } rdpedycClient.CloseChannel((ushort)channel.ChannelId); } catch { detectInfo.IsSupportRDPEDYC = false; } if (detectInfo.IsSupportRDPEDYC) { DetectorUtil.WriteLog("Detect RDPEDYC supported"); } else { DetectorUtil.WriteLog("Detect RDPEDYC unsupported"); } DetectorUtil.WriteLog("Passed", false, LogStyle.StepPassed); }