Write packets from the queue

def write_packets(self):
        """Write packets from the queue"""
        while self.running:
            if len(self.write_queue) > 0:
                self.write_queue[0].send(self.client)
                self.write_queue.pop(0)