Subject: Re: Multiple channels and epoll(7)

Re: Multiple channels and epoll(7)

From: Peter Stuge <>
Date: Mon, 16 Nov 2020 22:33:33 +0000

Hi Stef,

Stef Bon wrote:
> I am not that familiar with libssh2, but is there a fd associated with
> every channel?

No. RFC 4254 chapter 5 describes SSH channels. They are just multiplexed
byte streams within one SSH connection, described by RFC 4254.

> Or is there a mutex/cond which are doing the signalling data is available?

Also no.

Both of these constructs are not very widely portable, so they're a poor
fit for a cross-platform library such as libssh2.

> Only then you can do a per channel waiting/handling for io.

Well, every SSH connection runs over one TCP socket, and I think it
would be possible for libssh2 to assist applications in I/O handling
but noone has done it. At a minimum it requires a new state machine
in libssh2, but getting it all done neatly would probably require
rewriting much of libssh2...

Received on 2020-11-16