Advertisement
Guest User

Untitled

a guest
Jun 16th, 2019
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.28 KB | None | 0 0
  1. sock.settimeout(1.0)
  2. sock.bind(...)
  3.  
  4. while not done:
  5. try:
  6. data = sock.recv(1500)
  7. except timeout:
  8. continue
  9. sock.close()
  10.  
  11. while not done:
  12. try:
  13. data = sock.recv(1500)
  14. except timeout:
  15. continue
  16. if not data:
  17. break
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement