comm

From Coral Kangaroo, 4 Months ago, written in Plain Text, viewed 48 times.
URL https://code.nat.moe/view/929c6e51 Embed
Download Paste or View Raw
  1. #!/usr/bin/env python3
  2. import socket, select
  3.  
  4. def drain(sock: socket.socket):
  5.     rlist = [sock]
  6.     while True:
  7.         ready, _, _ = select.select(rlist, [], [], .0)
  8.         if len(ready) == 0: break
  9.         sock.recv(65535)
  10.  
  11. def wait(sock: socket.socket):
  12.     rlist = [sock]
  13.     while True:
  14.         ready, _, _ = select.select(rlist, [], [])
  15.         if len(ready) > 0: break
  16.  

Reply to "comm"

Here you can reply to the paste above

captcha