I have successfully created a desktop sharing solution where an RDPViewer connects to an RDPSession. That\'s all working beautifully. Now, however, I\'m trying to get the op
The Microsoft documentation is all wrong regarding reverse connections. Here's what you need to do (adapted from your code above):
RDP Session Side:
RDPSession session = new RDPSession();
session.Open();
string hostConnString = session.Invitations.CreateInvitation(null, "My Group Name", "12345", 1);
RDPViewer side (note that hostConnString
should be the same value as retrieved on the session side):
string viewerConnString = axRDPViewer1.StartReverseConnectListener(hostConnString, "My Name", "12345");
Now back to the RDP session side (note that the viewerConnString
should be the same value as retrieved from the viewer side):
session.ConnectToClient(viewerConnString);
And that should do it. A couple of things to note. The group name specified in CreateInvitation does not need to match anything anywhere else. I think it's just for reference should your program need to enumerate the invitations started by the host. The user name passed to StartReverseConnectListener can also be anything you want. This can be interrogated and used on the host side by looking at the RemoteName
property in the IRDPSRAPIAttendee
interface.