[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
channel_poll() is blocking
[Thread Prev] | [Thread Next]
- Subject: channel_poll() is blocking
- From: Bart Simpson <b_a_r_t@xxxxxxx>
- Reply-to: libssh@xxxxxxxxxx
- Date: Wed, 12 May 2010 15:03:17 +0200
- To: libssh@xxxxxxxxxx
Hello,I wrote a little test program to exec a command on a remote host and read the result from channel. Open session, authentification with public keys, exec command, etc. work all fine. But when I try to read something from the channel with this code part from the examples of libssh,
the function channel_poll() is blocking. After a few minutes -1 returned. Do anyone know, whats wrong? ... if (channel_is_open(channel)) { while (channel_poll(channel, 0) >= 0) { buf = buffer_new(); rc = channel_read_buffer(channel, buf, 0, 0); if (rc < 0) { buffer_free(buf); channel_close(channel); ssh_disconnect(session); ssh_finalize(); return 1; } printf("%s\n", (char *) buffer_get(buf)); buffer_free(buf); } } ... Regards, Thomas
Re: channel_poll() is blocking | Aris Adamantiadis <aris@xxxxxxxxxxxx> |