mirror of
https://github.com/afska/gba-link-connection.git
synced 2026-10-02 13:56:42 -05:00
Moving timeout check to onVBlank
This commit is contained in:
@@ -530,6 +530,18 @@ class LinkWireless {
|
||||
if (isConnected() && sessionState.frameRecvCount == 0)
|
||||
sessionState.recvTimeout++;
|
||||
|
||||
if (sessionState.recvTimeout >= config.timeout) {
|
||||
reset();
|
||||
lastError = TIMEOUT;
|
||||
return;
|
||||
}
|
||||
|
||||
if (!checkRemoteTimeouts()) {
|
||||
reset();
|
||||
lastError = REMOTE_TIMEOUT;
|
||||
return;
|
||||
}
|
||||
|
||||
sessionState.frameRecvCount = 0;
|
||||
sessionState.acceptCalled = false;
|
||||
sessionState.pingSent = false;
|
||||
@@ -610,12 +622,6 @@ class LinkWireless {
|
||||
if (!isSessionActive())
|
||||
return;
|
||||
|
||||
if (sessionState.recvTimeout >= config.timeout) {
|
||||
reset();
|
||||
lastError = TIMEOUT;
|
||||
return;
|
||||
}
|
||||
|
||||
if (!asyncCommand.isActive)
|
||||
acceptConnectionsOrTransferData();
|
||||
|
||||
@@ -894,12 +900,6 @@ class LinkWireless {
|
||||
trackRemoteTimeouts();
|
||||
addIncomingMessagesFromData(asyncCommand.result);
|
||||
|
||||
if (!checkRemoteTimeouts()) {
|
||||
reset();
|
||||
lastError = REMOTE_TIMEOUT;
|
||||
return;
|
||||
}
|
||||
|
||||
#ifndef USE_SEND_RECEIVE_LATCH
|
||||
if (state == CONNECTED) {
|
||||
// SendData (start)
|
||||
|
||||
Reference in New Issue
Block a user