2014-08-05 12:58 GMT+02:00 Jorge Jordão <[email protected]>:

> Hi,
>
> I am upgrading some code from sshd-core version 0.9.0 to 0.12.0.
>
> There's this method using
>     clientSession.getState().equals(Session.State.Running)
> for determining whether the session is still active.
>
> I believe one of the purposes was to determine whether there had been a
> disconnection due to timeout or any server-side event.
>
> My questions
> 1) In 0.12.0 the ClientSession no longer provides a getState. What new
> approach should I follow?
>

You need to register a SessionListener and react on sessionClosed() or use
!session.isClosing()


> 2) Is this a proper way to check for timeout/server-side disconnection?
> Any preferable alternative?
>

If you look at AbstractSession#doHandleMessage(), when
receiving SSH_MSG_DISCONNECT, the code and reason are printed to the debug
log, but you currently have no way to intercept those calls (only by
overriding the class).

If you need those, please raise a JIRA.


>
> Thanks
>
> --
> Jorge Jordão
>

Reply via email to