'Reads a number of bytes from the stream.
If a delimiter is encountered, calls Stream.parse() on the packet.'

def update(self, bytes=1024):

    packets = []
    self.buffer += self.socket.read(bytes)
    self.buffer = self.buffer.split(self.delimiter, 1)
    while (len(self.buffer) > 1):
        data = self.buffer[0]
        data = self.parse(data)
        if (data is not None):
            packets.append(data)
        self.buffer = self.buffer[(-1)]
        self.buffer = self.buffer.split(self.delimiter, 1)
    self.buffer = self.buffer[(-1)]
    self.extend(packets)
    return packets
