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

Re: Non blocking write


Hello,

ssh_set_fd_towrite() is a misnamed function that tells libssh the write
won't block of the file descriptor. It may have the opposite action as
you'd expect.
The best way of doing nonblocking write is to use
ssh_channel_set_blocking + ssh_channel_write, then use
ssh_handle_packets to have libssh flush the socket when it's possible
(however this function is currently private, we'll export it later), and
use ssh_blocking_flush with a timeout to flush the buffer.
A return code of SSH_AGAIN means there's still data to be flushed out.

Kr,

Aris

Le 21/05/12 09:13, Aviv Zilberman a écrit :
> *Hi ,*
> 
> * *
> 
> *Does ssh_channel_write become non-blocking already ? *
> 
> *if yes, in which version ?*
> 
> *If not, does calling to “ssh_set_fd_towrite” or
> “ssh_set_blocking(session, 0)” or “ssh_channel_set_blocking(channel, 0)”
> will help ?*
> 
> * *
> 
> *Thanks in advance,*
> 
> *Zilberman Aviv.*
> 
> This e-mail message is intended for the recipient only and contains
> information which is CONFIDENTIAL and which may be proprietary to ECI
> Telecom. If you have received this transmission in error, please inform
> us by e-mail, phone or fax, and then delete the original and all copies
> thereof.
> 

Follow-Ups:
RE: Non blocking writeAviv Zilberman <Aviv.Zilberman@xxxxxxxxxxx>
Archive administrator: postmaster@lists.cynapses.org