orlandos-nl / Citadel

SSH Client & Server in Swift
MIT License
181 stars 32 forks source link

[Feature Request] Get notified when ssh connection was closed #25

Closed AdrianDuan closed 1 year ago

AdrianDuan commented 1 year ago

Hi, I'm using Citadel as SSH Client to connect a remote server, just want to know if there is anyway or API to get notified/callback when the connection was closed(by remote/network environment changed)?

Joannis commented 1 year ago

I don't think that this is currently an API I provide, I can add it though.

Joannis commented 1 year ago

I'm giving it a shot, but the unit tests seem to indicate NIO thinks the connection is still active. Not sure why yet.

Joannis commented 1 year ago

I've added an .onDisconnect API on SSHClient. This callback will be triggered every time