Skip to content

Commit 030e993

Browse files
authored
Do not disconnect dashboard_client on read timeout (#414)
Currently, we disconnect from the dashboard server whenever we don't receive an answer inside the configured timeout and we throw an exception. The idea behind that was, that if we don't get an answer in time there's probably something wrong with the connection, anyway. However, it could just be that the command in question takes longer to process. There are a couple of commands where we manually add higher timeouts, such as generating the flight report, but also powering on the robot after an update can take longer if the firmware has to be updated. With the change in this commit, we still throw the exception leaving it up to the application layer to handle this. However, keeping the connection alive allows running other dashboard commands to inspect what's going on or simply retry with another timeout setting.
1 parent f04e347 commit 030e993

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

src/ur/dashboard_client_implementation_g5.cpp

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -167,10 +167,7 @@ std::string DashboardClientImplG5::read()
167167
{
168168
if (!TCPSocket::read((uint8_t*)&character, 1, read_chars))
169169
{
170-
disconnect();
171-
throw TimeoutException("Did not receive answer from dashboard server in time. Disconnecting from dashboard "
172-
"server.",
173-
*recv_timeout_);
170+
throw TimeoutException("Did not receive answer from dashboard server in time.", *recv_timeout_);
174171
}
175172
result << character;
176173
if (character == '\n')

0 commit comments

Comments
 (0)