[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

integration with libevent


Hi :)

I'm a little confused of how to integrate libssh with libevent.
I want to do non blocking writes on channels, but I don't know how to do
that.
I can do the following to get an callback called whenever the ssh socket
has some data:

client->ev_ssh = event_new(ev_base, ssh_get_fd(client->session),
  EV_READ | EV_PERSIST, on_ssh_read, client);
if (!client->ev_ssh)
tmate_fatal("Cannot create ssh event");
event_add(client->ev_ssh, NULL);

But I'm not sure how to trigger a callback when ssh_channel_write() is
ready again, is it's not just when the socket is writable, but also when
the channel window has enough room to proceed.
Maybe we could have a channel callback to tells us that the channel
is ready for writes?
If you have some design pattern, I'd be happy to hear your recommendation.

Thank you :)
Nico.

Follow-Ups:
Re: integration with libeventAris Adamantiadis <aris@xxxxxxxxxxxx>
Archive administrator: postmaster@lists.cynapses.org