fork download
  1. # multiconn-server.py
  2.  
  3.  
  4. def service_connection(key, mask):
  5.  
  6. # ...
  7.  
  8. if mask & selectors.EVENT_WRITE:
  9. if data.outb:
  10. print(f"Echoing {data.outb!r} to {data.addr}")
  11. sent = sock.send(data.outb) # Should be ready to write
  12. data.outb = data.outb[sent:]
  13.  
  14. # ...
Success #stdin #stdout 0.02s 9148KB
stdin
python multiconn-server.py 127.0.0.1 65432
stdout
Standard output is empty