- def data_received(self, data):
- rcv = data.decode('utf-8')
- if '\n' not in rcv:
- self.sess.err = ConnectionError('Connection lost while reading line')
- self.future.set_result(self.sess)
- raise ConnectionError('Connection lost while reading line')
+ def eof_received(self):
+ self.transport.close()
+ err = ConnectionError('Connection lost while reading line')
+ self.future.set_exception(err)