[erlang-questions] Closing a ssh channel from client side with killing the connection

Vipin Nair <>
Mon Sep 7 15:14:34 CEST 2015


Hello,

I am calling ssh_connection:exec/4 from a process implementing
the ssh_channel behaviour. I want to ensure that all commands
exit within some time limit. Say, someone runs a tail -f
/var/log/syslog, I want to ensure that this is not run beyond X
seconds.

My idea was to close the channel after the timeout, but I am not
sure how to do this. There may be multiple channel established
over the same connection so I cannot kill the connection. How
should I do this?

A quick glance at the RFC[1] shows that either party can close
the channel. So this perhaps could be added as a new public api
in ssh_channel module.

[1]: https://www.ietf.org/rfc/rfc4254.txt


-- 
Regards,
Vipin


More information about the erlang-questions mailing list