code: def _process_stdin(self):
          
          with nonblocking(sys.stdin.fileno()):
              data = self._stdin_reader.read()
  
          # Send input in chunks of 4k.
          step = 4056
          for i in range(0, len(data), step):
              self._send_packet({
                  'cmd': 'in',
                  'data': data[i:i + step],
              })
docs: Received data on stdin. Read and send to server.