I am trying to implement ssh client with libssh.
According libssh doc: http://api.libssh.org/stable/group__libssh__channel.html#gae86b0704a1f2bdebb268b55567f7f47b ssh_channel_open_forward is supporting none block mode.
Here is my sequence:
1. ssh_new ()
2. ssh_set_blcoking (session, false)
3. ssh_connect () :None Blocking -> OK
4. ssh_userauth_password (session, NULL, "password") :None Blocking -> OK
5. ssh_channel_new (session)
6. ssh_channel_set_blcoking (channel, 0)
7. ssh_channel_open_foward(...) :Bocking -> NG
I am sure that the same code on MaxOS(X) ssh_channel_open_foward function is none blcoking. On linux(ubuntu) and Win32(win7/xp) ssh_channel_open_foward is blocking.
also, add test code: assert (ssh_is_blocking (session_->session ()) == 0). assert is never happened, that means the channel is already switched to none block mode. But ssh_channel_open_foward never returns SSH_AGAIN. it is totally blocked.
Any help will be very thankful.