For information on the latest version, please have a look at 1.33.5.
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. |
Caution
The RT channel cannot be connected again in the same process. After disconnect_rt_control, connect_rt_control returns 0 and prints Already connected. To connect the RT channel again, restart the application.
Note
Disconnecting automatically resets all RT configurations and internal handles.
Recommended after calling stop_rt_control to ensure a clean shutdown.
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.
Use only once per session; the destructor will also release the handle if still active.