In my project, where I use the example code shared below, I always start by opening a connection using the baglantiAc() method. Then, I use the DegerOkuInt() method to check if the connection is established (isconnected) and to read values. Generally, there is no issue, but when the power to the PLC is off and the connection cannot be established, no exception is thrown. The application freezes at that point. After restarting, it reconnects and works again. This situation always requires my manual intervention. How can I ensure an exception is thrown when the connection is lost?
