The KRdp::RdpConnection class represents an active RDP session between a client and the server. It manages the RDP communication protocol and operates in its own dedicated thread.
Developers can interact with the session through several component handlers:
inputHandler(): Manages user input from the client.videoStream(): Handles the video data stream.cursor(): Manages the remote cursor.clipboard(): Manages clipboard synchronization.displayControl(): Controls display settings.networkDetection(): Monitors network conditions.
Monitoring the session lifecycle is done via the state() method and the stateChanged(State newState) signal.
// Example of observing session state
connect(rdpConnection, &KRdp::RdpConnection::stateChanged, [](KRdp::RdpConnection::State newState) {
if (newState == KRdp::RdpConnection::State::Running) {
qDebug() << "Session is now running";
}
});
KRdp::RdpConnection::State currentState = rdpConnection->state();