def read_fd(self): while True: try: msg = os.tp_read(self.tuntap.fd, 1500) if not msg: break except IOError: break if self.ws.closed: break self.ws.send(msg, True)
def read_fd(self): while not self.stopping: try: msg = os.tp_read(self.tuntap.fd, 1500) if not self.ws.connected: break if not msg: self.stopping = True self.ws.close() break except IOError: break self.ws.send_binary(msg)
def read(self, *args): return os.tp_read(*args)
def read(self, nbytes): return tp_read(self.fd, nbytes)