def _read_chunk_from_socket(socket):
fd = socket.fileno()<EOL>f = Future()<EOL>def read_callback():<EOL><INDENT>get_event_loop().remove_reader(fd)<EOL>try:<EOL><INDENT>data = socket.recv(<NUM_LIT>)<EOL><DEDENT>except OSError as e:<EOL><INDENT>logger.warning('<STR_LIT>'<EOL>'<STR_LIT>', e)<EOL>f.set_result('<STR_LIT>')<EOL>return<EOL><DEDENT>if data:<EOL><INDENT>f.set_result(data)<EOL><DEDENT>else:<EOL><INDENT>f.set_exception(BrokenPipeError)<EOL><DEDENT><DEDENT>get_event_loop().add_reader(fd, read_callback)<EOL>return f<EOL>
(coroutine)
Turn socket reading into coroutine.