Hello,
I'm seeing a problem with virtual channels when connecting to Windows 8 or Server 2012 over RDP, which does not happen with Windows 7 or older systems.
I'm using a request-reply type of protocol, where the server component sends a request to the client over virtual channel and client answers with the data. When RDP'ing into Windows 8, I get a very high turnaround time (16-18 milliseconds). There is no such problem when RDPing into Windows 7 or XP (turnaround time is less than 1ms). There are also no other problems with this RDP connection - it works good and fast, except virtual channel.
I can easily reproduce the problem with the test application and client dll that I've created. The program opens a virtual channel and sends 100 bytes of data. When dll receives CHANNEL_EVENT_DATA_RECEIVED notification, it replies with another 100 bytes of data. Basically it's just a simple ping.
What I've tried/checked already:
- Tried different Remote Desktop Client versions - same thing.
- Checked ping time between client and server machines, which turned out to be less than 1 ms (it is a Gigabit Ethernet connection).
- Tried with Dynamic Virtual Channels - same result.
- Tried reading/writing virtual channel with ReadFile/WriteFile through the handle returned by WTSQueryVirtualChannel() instead of WTSVirtualChannelRead/WTSVirtualChannelWrite - same result.
- Disabled checksum offloading in network adapter properties - same result.
- Tried different virtual channel priorities - same result.
- Tried with different amounts of data up to CHANNEL_CHUNK_LENGTH - same result.
- Disabled encryption (to the degree allowed by RDP settings) and compression.
- Played with other RDP options in Group Policy, which on my mind could affect the problem - nothing helped.
One other interesting thing I found with Wireshark when I tried to check if it was a TCP problem. I can see that the data goes to client only after 8-9 milliseconds after the call to WTSVirtualChannelWrite. The client's reply is received almost immediately (!!!), but WTSVirtualChannelRead call in my application completes only after another 8-9 milliseconds. Thus, resulting in a 16-18 milliseconds turnaround time.
Any ideas why this could happen?