[Libssh] Minor problem with polling/EOF
Aris Adamantiadis
aris at 0xbadc0de.be
Mon Mar 3 16:41:08 CET 2008
Matt Lawson a écrit :
> Hi,
>
> I ran into a strange thing. When communicating with a
> remote machine and the remote machine disconnects, I
> am able to read everything down to the last character
> of the stream that the remote device sent, but when
> trying to read the very last char:
>
> channel_is_open() indicates the channel is open
>
> channel_poll() indicates that there 1 char remaining
> to be read
>
> channel_read_nonblocking() however can never seem to
> read this last character (always returns zero), even
> with letting it try many times.
>
> Now my solution was to expose the "channel_is_eof()"
> function in libssh.h. When I call this function, it
> indicates that the channel is at EOF.
>
> Not sure if that's the best solution. Perhaps
> channel_is_eof() was intentionally hidden?
>
> Dunno, but this seems to have worked for me.
>
> - matt
>
Hello,
does Rodolphe Rocca's patch posted on this list correct your problem ?
Regards,
Aris
More information about the Libssh
mailing list