[
https://issues.apache.org/jira/browse/SSHD-769?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Goldstein Lyor resolved SSHD-769.
---------------------------------
Resolution: Won't Fix
Assignee: Goldstein Lyor
{{SshServer}} was not designed for restart - so this is not a bug but rather a
feature request at most. That being said, you can write an abstraction that
hides the "fake" server and creates a *new* instance every time it is
"re-started"
> Cannot close SSH server after restart
> -------------------------------------
>
> Key: SSHD-769
> URL: https://issues.apache.org/jira/browse/SSHD-769
> Project: MINA SSHD
> Issue Type: Bug
> Reporter: Stefan Birkner
> Assignee: Goldstein Lyor
>
> I wrote a tool (Fake SFTP server rule) that provides a fake SFTP server for
> people testing their SFTP code with JUnit.
> https://github.com/stefanbirkner/fake-sftp-server-rule It uses Apache SSHD
> under the hood.
> When a user want to change the port I restart the server:
> {code:title=FakeSftpServerRule.java}
> server.stop();
> server.setPort(port); //The bug also occurs if I don't set the port
> server.start();
> {code}
> Unfortunately when I call {{server.close()}} afterwards the server is not
> shutdown. This is because the {{AbstractCloseable}} state is not reset on
> {{server.start()}}
> It should either be possible to shutdown the server after a restart of a
> restart should be prohibited.
>
--
This message was sent by Atlassian JIRA
(v6.4.14#64029)