Skip to content

Instantly share code, notes, and snippets.

@Geesu
Created March 14, 2017 14:06
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save Geesu/9ee61ab333762d3261dcd78b19a7dfa7 to your computer and use it in GitHub Desktop.
while True:
pollrc = ep.select(timeout=int(opts.read_timeout) if int(opts.read_timeout) > 0 else None)
sys.stdout.flush()
try:
buf = sock.recv(4096, socket.MSG_DONTWAIT)
rbuf += buf
while True:
sys.stdout.flush()
rbuf = rbuf.lstrip()
# f = open('/tmp/raw_' + str(i), 'wb')
# f.write(rbuf)
# f.close()
# i += 1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment