def _ssh_channel_read(ssh_channel_int, count, is_stderr):
buffer_ = create_string_buffer(count)<EOL>while <NUM_LIT:1>:<EOL><INDENT>received_bytes = c_ssh_channel_read(ssh_channel_int, <EOL>cast(buffer_, c_void_p), <EOL>c_uint32(count),<EOL>c_int(int(is_stderr)))<EOL>if received_bytes == SSH_ERROR:<EOL><INDENT>ssh_session_int = _ssh_channel_get_session(ssh_channel_int)<EOL>error = ssh_get_error(ssh_session_int)<EOL>raise SshError("<STR_LIT>" % (error))<EOL><DEDENT><DEDENT>DO: This call might return SSH_AGAIN, even though we should always be <EOL><INDENT>blocking. Reported as bug <EOL>elif received_bytes == SSH_AGAIN:<EOL><INDENT>continue<EOL><DEDENT>else:<EOL><INDENT>break<EOL><DEDENT><DEDENT>DO: Where is the timeout configured for the read?<EOL>return buffer_.raw[<NUM_LIT:0>:received_bytes]<EOL>
Do a read on a channel.