def _parse_socket_data(cls, binary_string): """ Parses data from socket_read() and stores packet objects in cls.incoming_packets Recursive function. Handles multiple packets in one binary string """ packet = SteamPacket.unpack(binary_string) packet.timestamp = time.time() if packet.keep_alive_packet: out('Keep alive') else: cls.incoming_packets.append(packet) if packet.remaining_data: cls._parse_socket_data(packet.remaining_data)
def _parse_socket_data(cls,binary_string): """ Parses data from socket_read() and stores packet objects in cls.incoming_packets Recursive function. Handles multiple packets in one binary string """ packet = SteamPacket.unpack(binary_string) packet.timestamp = time.time() if packet.keep_alive_packet: out('Keep alive') else: cls.incoming_packets.append(packet) if packet.remaining_data: cls._parse_socket_data(packet.remaining_data)