()
| 21 | |
| 22 | # input reader |
| 23 | def stdin_callback(): |
| 24 | line = sys.stdin.buffer.readline().decode('utf-8') |
| 25 | if not line: |
| 26 | loop.stop() |
| 27 | else: |
| 28 | ws.send_str(name + ': ' + line) |
| 29 | loop.add_reader(sys.stdin.fileno(), stdin_callback) |
| 30 | |
| 31 | @asyncio.coroutine |