mirror of
https://github.com/saitohirga/WSJT-X.git
synced 2025-05-30 21:32:29 -04:00
Change recent HRD retry to only retry reply check.
Because of a possible Windows or Qt defect in TCP/IP received bytes detection it seems necessary to retry QTCPSocket::waitReadReady() blocking calls after a time out response as there may actually be data waiting. git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/branches/wsjtx@4256 ab8295b8-cf94-4d9e-aec4-7959e3be5d79
This commit is contained in:
parent
7e2cf9b9e6
commit
e8e5ffefe9
@ -701,10 +701,6 @@ QString HRDTransceiver::send_command (QString const& cmd, bool no_debug, bool pr
|
|||||||
|
|
||||||
auto context = '[' + QString::number (current_radio_) + "] ";
|
auto context = '[' + QString::number (current_radio_) + "] ";
|
||||||
|
|
||||||
unsigned retries {5};
|
|
||||||
bool replied {false};
|
|
||||||
while (!replied && --retries)
|
|
||||||
{
|
|
||||||
int bytes_to_send;
|
int bytes_to_send;
|
||||||
int bytes_sent;
|
int bytes_sent;
|
||||||
if (v4 == protocol_)
|
if (v4 == protocol_)
|
||||||
@ -743,6 +739,12 @@ QString HRDTransceiver::send_command (QString const& cmd, bool no_debug, bool pr
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// waitForReadReady appears to be unreliable on Windows timing out
|
||||||
|
// when data is waiting so retry a few times
|
||||||
|
unsigned retries {5};
|
||||||
|
bool replied {false};
|
||||||
|
while (!replied && --retries)
|
||||||
|
{
|
||||||
replied = hrd_->waitForReadyRead (socket_wait_time);
|
replied = hrd_->waitForReadyRead (socket_wait_time);
|
||||||
if (!replied && hrd_->error () != hrd_->SocketTimeoutError)
|
if (!replied && hrd_->error () != hrd_->SocketTimeoutError)
|
||||||
{
|
{
|
||||||
|
@ -116,9 +116,9 @@ private:
|
|||||||
ModeMap mode_A_map_; // The map of modes available for VFO
|
ModeMap mode_A_map_; // The map of modes available for VFO
|
||||||
// A.
|
// A.
|
||||||
|
|
||||||
int mode_B_dropdown_; // The map of modes available for VFO
|
int mode_B_dropdown_; // The drop down index for VFO B mode
|
||||||
// B. May be -1 if independent VFO
|
// setting. May be -1 if independent
|
||||||
// mode setting not available.
|
// VFO mode setting not available.
|
||||||
|
|
||||||
ModeMap mode_B_map_; // The map of modes for VFO B.
|
ModeMap mode_B_map_; // The map of modes for VFO B.
|
||||||
|
|
||||||
@ -126,8 +126,10 @@ private:
|
|||||||
// operation. May be -1 if no button
|
// operation. May be -1 if no button
|
||||||
// is available.
|
// is available.
|
||||||
|
|
||||||
int split_mode_dropdown_; // The drop down list that allows
|
int split_mode_dropdown_; // The drop down index that allows
|
||||||
// split mode to be turned on and off.
|
// split mode to be turned on and
|
||||||
|
// off. May be -1 if no such drop down
|
||||||
|
// exists.
|
||||||
|
|
||||||
bool split_mode_dropdown_write_only_; // Some rigs cannot report
|
bool split_mode_dropdown_write_only_; // Some rigs cannot report
|
||||||
// split status.
|
// split status.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user