You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@mina.apache.org by "yanliangchao (via GitHub)" <gi...@apache.org> on 2023/03/20 14:07:20 UTC

[GitHub] [mina-sshd] yanliangchao opened a new issue, #339: Can not start the server again

yanliangchao opened a new issue, #339:
URL: https://github.com/apache/mina-sshd/issues/339

   ### Description
   
   SshServer server = SshServer.setUpDefaultServer();
   ......
   server.start();
   .....
   server.stop();
   ......
   server.start();
   
   
   
   ### Motivation
   
   I want to start the SSH server again after stopping, but I can't.
   
   ### Alternatives considered
   
   _No response_
   
   ### Additional context
   
   _No response_


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@mina.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@mina.apache.org
For additional commands, e-mail: dev-help@mina.apache.org


[GitHub] [mina-sshd] tomaswolf closed issue #339: Can not start the server again

Posted by "tomaswolf (via GitHub)" <gi...@apache.org>.
tomaswolf closed issue #339: Can not start the server again
URL: https://github.com/apache/mina-sshd/issues/339


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@mina.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@mina.apache.org
For additional commands, e-mail: dev-help@mina.apache.org


[GitHub] [mina-sshd] tomaswolf commented on issue #339: Can not start the server again

Posted by "tomaswolf (via GitHub)" <gi...@apache.org>.
tomaswolf commented on issue #339:
URL: https://github.com/apache/mina-sshd/issues/339#issuecomment-1476903059

   > I want to start the SSH server again after stopping, but I can't.
   
   Why not?


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@mina.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@mina.apache.org
For additional commands, e-mail: dev-help@mina.apache.org


[GitHub] [mina-sshd] tomaswolf commented on issue #339: Can not start the server again

Posted by "tomaswolf (via GitHub)" <gi...@apache.org>.
tomaswolf commented on issue #339:
URL: https://github.com/apache/mina-sshd/issues/339#issuecomment-1483893893

   Not being able to re-start a closed client or server is basically due to many components in Apache MINA sshd having state machines that end in a "closed" terminal state. These state machines typically have no transition back to the initial state, and any attempt to implement such a transition would only complicate the code *a lot*. I'm not even sure it'd be always possible. It also does not fit with the lifecycle of SSH protocol objects such a sessions or channels. Once a channel is closed, it cannot be re-opened (but a new channel can be opened).
   
   Hence using a `ServerBuilder` or `ClientBuilder` and creating a new server or client instance is the way to go. I'll close this issue as "won't fix".


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@mina.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@mina.apache.org
For additional commands, e-mail: dev-help@mina.apache.org


[GitHub] [mina-sshd] yanliangchao commented on issue #339: Can not start the server again

Posted by "yanliangchao (via GitHub)" <gi...@apache.org>.
yanliangchao commented on issue #339:
URL: https://github.com/apache/mina-sshd/issues/339#issuecomment-1477333056

   When I execute the start method in SshServer, he will first use the isClosed method to make a judgment.
   ![image](https://user-images.githubusercontent.com/32755174/226528857-6df484fa-b944-4f66-b185-f91465ee5ca5.png)
   However, after I execute the stop method, the State will be changed to Closed, which will cause me to fail to execute the next step through this judgment after executing the start method again.
   ![image](https://user-images.githubusercontent.com/32755174/226528856-83beab8d-47f9-4d13-b6cb-fd97d258f67d.png)
   How do I change the value of state.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@mina.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@mina.apache.org
For additional commands, e-mail: dev-help@mina.apache.org


[GitHub] [mina-sshd] tomaswolf commented on issue #339: Can not start the server again

Posted by "tomaswolf (via GitHub)" <gi...@apache.org>.
tomaswolf commented on issue #339:
URL: https://github.com/apache/mina-sshd/issues/339#issuecomment-1478436603

   Oh. So it's on purpose. See [SSHD-340](https://issues.apache.org/jira/browse/SSHD-340) for the motivation.
   
   `SshServer` and `SshClient` are not inteded to be re-used like this. Instead, use a `ServerBuilder` or `ClientBuilder` and build a new instance.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@mina.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@mina.apache.org
For additional commands, e-mail: dev-help@mina.apache.org