Closed AsafMag closed 6 years ago
Hi, and what behavior do you expect? Exception? D
I think an exception could do the trick, considering the function can't return a boolean result or launch an event because it is synchronous
@danikf This doesn't seem to work even after the updates you uploaded yesterday: I launched a command for 9999 seconds and disabled the ethernet interface on the PC. Connection.IsConnected
was then set to false
but ExecuteListWithDuration
was still running. Can you reopen?
Hi, could you please test your scenario with last commited fix?
Thanks, D
It returns immediately. There are other problems now:
IsRunning
stays true
(kind of answers the first problem but I believe it shouldn't be like that).Shouldn't it break instead of return? It will cause a TikConnectionException
to be thrown.
Hi,
the problem in my test scenario is, that !done
is returned before connection si closed. So in this situation, response with incomplete list of items is (from my point of view) correct.
> /tool/torch
> =interface=ether1
> .tag=1
> /system/reboot
< !re
< =tx=864
< =rx=1024
< =tx-packets=2
< =rx-packets=2
< .tag=1
<
< !re
< =tx=864
< =rx=1024
< =tx-packets=2
< =rx-packets=2
< .tag=1
<
< !re
< =tx=1776
< =rx=960
< =tx-packets=2
< =rx-packets=2
< .tag=1
<
< !re
< =tx=1776
< =rx=960
< =tx-packets=2
< =rx-packets=2
< .tag=1
<
< !done
<
< !done
< .tag=1
... connection closed ...
Hi, finally I have implemented both scenarios (overloads with exception and also second overload with returning incomplete response with error info).
In hope it solved your case, D PS: I would still recommend to use 1) Single connection + multiple ExecuteAsync calls 2) Multiple connections + single sync call
@danikf Looking good, thanks :)
The following code:
Doesn't stop when I shut down my MikroTik board. A breakpoint inside
ExecuteListWithDuration
shows thatConnection._isOpened == true
.I haven't tested other functions such as
ExecuteAsync
etc.