diff --git a/bec_rcon.py b/bec_rcon.py index fea1f63..cdc8453 100644 --- a/bec_rcon.py +++ b/bec_rcon.py @@ -439,7 +439,10 @@ async def waitForResponse(self): for i in range(0,timeout): if(d < len(self.serverCommandData)): #new command package was received self.sendLock = False #release the lock - return self.serverCommandData.pop()[1] + data = self.serverCommandData.pop()[1] + if(len(self.serverCommandData) >= self.serverCommandData.maxlen/2): + self.serverCommandData.clear() + return data await asyncio.sleep(0.1) if(self.options['debug']): print("Failed to keep connection - Disconnected")