-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
xrdpapi: Add a way to monitor connect/disconnect events #3640
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: devel
Are you sure you want to change the base?
Conversation
|
Hi, First of all, apologies for the delay. I think this is a possible solution even if it is different from what we've discussed. My main issue, and please correct me if I am wrong, is that we might not be using virtual channels appropriately here. As I understand it, virtual channels are intended for sending and receiving data between the RDP client and server, however this implementation seems to go against that for two reasons:
From my perspective, this should be something that is separate from virtual channel communication. The quickest solution that comes into my mind is using a separate socket for this such as Please do let me know your thoughts. Thanks. |
|
@vscfreire - as ever, thanks for the feedback and an interesting discussion. No apologies are necessary. Am I right in that your concerns are related to the implementation detail only? I don't think the choice of implementation would affect the API as presented to the user. At an OS level, the sockets for each channel (including this one) are all separate anyway. I'd thought when I started looking at this that all the channels would be multiplexed over a single socket, but that's not the implementation that was chosen by the original developer. Each channel ends up with its own socket. The file system entry It would be simple enough to modify the initial PDU sent to an open xrdpapi socket to include a value specifying whether or not this was a private channel of some sort. That would prevent the user being able to open Let me know if that would help. I've one other question; having thought about this myself in the last few days, I was expecting you to come up with a question regarding how the user determines the initial state of the RDP client connection when running an xrdpapi client up. Is this a concern of yours? If so, what sort of mechanism would you like to see to get this information at an API level? |
|
Hi,
Yes. In terms of functionality this should work.
I think this is a great idea.
From my perspective, the xrdpapi client first tries to use Another question I have is how the client should handle a Thanks. |
|
OK - I'll add a private channels flag.
I see the problem with We could implement a special function |
|
Hi, I can't think of a reason as to why that would be a problem for this use case, but I also don't see the benefit of using that over returning an error from the WTS functions. Could you clarify why implementing WTSGetLastError() might be better? Thanks |
|
I'm not really fussed either way myself. The |
|
Hi, To simplify for now, I think it is best to just stick with returning an error error from the WTS functions |
882d410 to
10a51f8
Compare
The xrdp private channels are no longer in the same namespace as standard xrdp channels, making it impossible for the user to open them with the API in xrdp/xrdpapi.h For readability, a single struct is now passed from xrdpapi to chansrv for the connect operation.
Allos the user to determine whether a call to WTSRegisterSessionNotificationEx() can be retried or not.
10a51f8 to
9e81573
Compare
|
Updated as requested, with minimal testing so far! The error return was trickier to do than I expected. Because Windows uses true for OK, I've only got the value 0 for an error return, so as to preserve some kind of compatibility. Consequently I've added an optional error code to some of the calls. Let me know what you think. We're still in draft at the moment. |
9e81573 to
8c15398
Compare
Very limited function to check the connection status of a client
8c15398 to
396bfd5
Compare
|
As a small note, I had a think about this last night, and I'm sure the interface between xrdpapi and chansrv can be improved somewhat. That's not related to the API however. I'll save more updates until my next batch of changes. |
|
Hi, Apologies for the delay. It seems to me this is exactly what I am looking for. When I get the chance, I will test this code in my custom channel. Thanks for all the hard work |
|
That's great @vscfreire I'll currently looking at a couple of other issues, but when I've got those done I'll rework the internal API. That's not going to affect xrdpapi however, so we should be able to work in parallel. |
Windows definitions are removed from the chansrv, as they are not needed here.
|
Internal API reworked to remove 'Windows' definitions from chansrv. |
Fixes #3622
Demo program included.
@vscfreire - this is a draft for now. I'd very much appreciate any comments you have. The API is a little different from what we discussed, and you may have a different (and better) mental image of how this all should work.