[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
asynchronous channel write
[Thread Prev] | [Thread Next]
- Subject: asynchronous channel write
- From: Torsten Kuehnel <tdkuehnel@xxxxxxxxxxxxxxxxxxxxx>
- Reply-to: libssh@xxxxxxxxxx
- Date: Mon, 13 Jan 2020 17:48:40 +0100
- To: libssh@xxxxxxxxxx
Working on the reference implementation of the ncot library i am confronted with the follwoing use case: Data packets are to be received and send from/to several simultaneous open ssh-like encrypted channels to instances of the same program running on other hosts over the network. The one client-server connection -> one thread paradigm does not fit so well. Packets have to be validated, act upon and processed in different ways, and need to be resend to other connections - this is the real part of the implementation. So my approach currently is the following one: A mainloop with ssh_event_dopoll manages to call my channel callbacks i have established during initialization of the several sessions. But when it comes to write my packets over the channels, libssh only offers a blocking ssh_channel_write call what is not what i want. When the poll returns with write possible, i usually try to write as much as i can and send tells me how much succeded. How can i achieve this behaviour using libssh ? thanks for any insights in advance, keep up the good work ! -- Torsten Kuehnel <tdkuehnel@xxxxxxxxxxxxxxxxxxxxx>
Re: asynchronous channel write | g4-lisz@xxxxxxxxxxxx |