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

Re: integration with libevent


Hi Nicolas,

I did some work on this recently and it's pending merging in libssh
master. It describes exactly what you want:
https://git.libssh.org/users/aris/libssh.git/commit/?h=connector&id=13c0395dd5dc6865412be6c151398f9b14788898

We're also very interested in working examples of integration with other
main loop systems such as libevent, and why not provide "official"
integration.

Thanks,

Aris

Le 17/09/15 19:03, Nicolas Viennot a écrit :
> 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 libeventStef Bon <stefbon@xxxxxxxxx>
References:
integration with libeventNicolas Viennot <nicolas@xxxxxxxxxxx>
Archive administrator: postmaster@lists.cynapses.org