auto-sync
This commit is contained in:
parent
d1856c1406
commit
d7c99c5199
|
@ -105,6 +105,8 @@ public class TestingUtils {
|
|||
}
|
||||
|
||||
static EngineChart nextChart() {
|
||||
getNextWaveChart();
|
||||
getNextWaveChart();
|
||||
return EngineChartParser.unpackToMap(getNextWaveChart());
|
||||
}
|
||||
|
||||
|
|
|
@ -165,9 +165,9 @@ public class BinaryProtocol {
|
|||
long start = System.currentTimeMillis();
|
||||
|
||||
while (true) {
|
||||
dropPending();
|
||||
|
||||
try {
|
||||
dropPending();
|
||||
|
||||
stream.write("~\n".getBytes());
|
||||
synchronized (cbb) {
|
||||
boolean isTimeout = waitForBytes(2, start, "switch to binary");
|
||||
|
@ -194,7 +194,7 @@ public class BinaryProtocol {
|
|||
}
|
||||
}
|
||||
|
||||
private void dropPending() {
|
||||
private void dropPending() throws IOException {
|
||||
synchronized (cbb) {
|
||||
if (isClosed)
|
||||
return;
|
||||
|
@ -337,8 +337,9 @@ public class BinaryProtocol {
|
|||
public byte[] exchange(byte[] packet, String msg, boolean allowLongResponse) {
|
||||
if (isClosed)
|
||||
return null;
|
||||
dropPending();
|
||||
try {
|
||||
dropPending();
|
||||
|
||||
sendCrcPacket(packet);
|
||||
return receivePacket(msg, allowLongResponse);
|
||||
} catch (InterruptedException e) {
|
||||
|
|
Loading…
Reference in New Issue