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

Re: Working on keepalive messages while waiting for local connection



On 14.04.2018 17:58, Andreas Schneider wrote:
> On Saturday, 14 April 2018 15:55:20 CEST g4-lisz@xxxxxxxxxxxx wrote:
>> On 11.04.2018 18:09, g4-lisz@xxxxxxxxxxxx wrote:
>>> On 11.04.2018 17:31, Andreas Schneider wrote:
>>>> ould appreciate a lot if someone could show me some sample code.
>>>> I think that ssh_event_dopoll() will handle it and call the appropriate
>>>> callback. Don't use ssh_select()
>>>>
>>>> In master we have the new connector API which is easier to use, see
>>>> https://git.libssh.org/projects/libssh.git/tree/examples/ssh_client.c
>>> Thanks, I think that's the issue: The main event polling is not called
>>> why my code waits for a connection. But how do I get the event to which
>>> are attached the default handlers of libssh?
>>>
>>> I also looked at the sample code which uses the event API for polling on
>>> the channel. But this would not solve my issue with global keep-alive
>>> requests. They are sent while no channel exists. IMHO it's an issue with
>>> handling messages in the main loop while no channels are open.
>> Well, maybe I should ask it this way:
>>
>> How can I keep the internal main loop running, i.e. the default
>> callbacks being triggered, when nothing else is going on?
> You need to call of of the ssh poll functions, e.g. ssh_channel_poll() or 
> ssh_event_dopoll() this will also trigger the standard callbacks if something 
> is in the queue.
This is what I tested before (ssh_event_dopoll)... But maybe it did not
work because I had a "blank" event without anything attached to it. I'll
try it again.
Thanks.

Archive administrator: postmaster@lists.cynapses.org