Changeset 90cd378 in ammosreader


Ignore:
Timestamp:
05/28/23 15:46:54 (2 years ago)
Author:
Enrico Schwass <ennoausberlin@…>
Branches:
AmmosSource
Children:
351c39d
Parents:
d6535bd
Message:

off by one error in AmmosSocketSource fixed

Location:
ammosreader
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • ammosreader/AbstractAmmosReader.py

    rd6535bd r90cd378  
    4848    def resync(self):
    4949        """I try to resync, when reading from source was garbled."""
     50        logger.info("Resync")
    5051        self.source.resync()
    5152
  • ammosreader/AmmosSocketSource.py

    rd6535bd r90cd378  
    2525        logger.info("Start reading bytes from socket")
    2626        try:
    27             while len(byte_array) < bytes_to_read:
     27            while bytes_to_read > len(byte_array):
    2828                logger.info("Remaining Bytes: %s", bytes_to_read - len(byte_array))
    2929                self.source.settimeout(self.timeout)
     
    3737            logger.info("Timeout error while reading from socket")
    3838            return None
     39        logger.info("All bytes read")
    3940        return b''.join(byte_array)
Note: See TracChangeset for help on using the changeset viewer.