libssh2_poll_channel_read(3)

πŸ“¦
version 1.11.1 Β· 3 versions
, in alpine 3.22, alpine 3.23, alpine 3.24, arch rolling, debian trixie, epel 10, epel 9, fedora 43, fedora 44, opensuse-leap 16.0, ubuntu questing, ubuntu resolute, ubuntu stonking

πŸ’– libssh2_poll_channel_read β€” the libssh2 manual, bestie edition πŸ’–

okay so. this page lives in the libssh2 manual, and we're talking about libssh2_poll_channel_read(3). yes, the third section. yes, we're being fancy about it. πŸŽ€


✨ NAME ✨

libssh2_poll_channel_read β€” check if data is available

like. literally that's the whole job. vibe check on your read buffer. πŸ¦‹


🌸 SYNOPSIS 🌸

#include <libssh2.h>

int
libssh2_poll_channel_read(LIBSSH2_CHANNEL *channel, int extended);

πŸ’… DESCRIPTION πŸ’…

okay bestie, before you get attached: this function is deprecated. Do note use. like, that's the actual wording, and honestly? iconic typo, we're keeping it, but the energy is real β€” don't use this one. πŸ™ˆ

so what does it even do. libssh2_poll_channel_read(3) checks to see if data is available in the channel's read buffer. that's it. that's the whole main character moment. and here's the catch: no attempt is made with this method to see if packets are available to be processed. so it's a peek at the buffer and nothing more, no packet-processing intel whatsoever. 😭

if you want the full polling support β€” the real, complete, everything-bagel version β€” go use libssh2_poll(3) instead. periodt. πŸ‘‘


⭐ RETURN VALUE ⭐

  • returns 1 when data is available
  • returns 0 otherwise

fr fr, those are the only two outcomes. simple queen behaviour. πŸ’–


🫢 SEE ALSO 🫢


🌈 quick recap for the group chat: deprecated, don't use it, it only checks the read buffer, it does NOT check for packets to process, and libssh2_poll(3) is the one you actually want. iykyk. ✨

and that's the page, babe β€” straight out of libssh2 0.15, dated 14 Dec 2006. ancient. archival. still slaying in the man pages. πŸ§šπŸ’œ mwah, go poll responsibly. πŸ’