disconnect_rt_control
This function terminates the active UDP real-time control session established with the robot controller. It safely closes the RT communication channel and resets all internal RT configurations.
Definition
DRFLEx.h within class CDRFLEx, public section
bool disconnect_rt_control() {
return _disconnect_rt_control(_rbtCtrlUDP);
};
Parameter
None
Return
Value |
Description |
|---|---|
1 |
The disconnect request was sent, or the RT channel was not open. A return of 1 does not confirm that the controller ended the session. |
0 |
The disconnect request could not be sent on the open RT channel. The function closes the RT channel in either case. |
Note
Disconnecting automatically resets all RT configurations and internal handles.
Recommended after calling stop_rt_control to ensure a clean shutdown.
After this function returns, connect_rt_control can connect the RT channel again in the same process.
Example
drfl.connect_rt_control("192.168.137.100", 12347);
drfl.start_rt_control();
// Stop streaming and close the UDP channel
drfl.stop_rt_control();
drfl.disconnect_rt_control();
In this example, the function safely closes the active UDP RT control session and resets internal configurations used for real-time streaming.
Tips
Always stop RT streaming before disconnecting.
Call it once per connection. If the
CDRFLExobject is destroyed without this call, the library closes the RT channel but does not send the disconnect request to the controller.