[ 
https://issues.apache.org/jira/browse/SSHD-993?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17108054#comment-17108054
 ] 

Lyor Goldstein commented on SSHD-993:
-------------------------------------

I don't think this has anything to do with the server. The server is +passive+ 
- i.e., it does not initiate connection - only clients do. Therefore I am not 
sure how it is the "fault" of the MINA SSHD server. I believe you can confirm 
that if you run Wireshark or TCPDUMP to see the connection attempts.

> an additional connection is created when connect to a sshd server
> -----------------------------------------------------------------
>
>                 Key: SSHD-993
>                 URL: https://issues.apache.org/jira/browse/SSHD-993
>             Project: MINA SSHD
>          Issue Type: Bug
>    Affects Versions: 2.1.0
>            Reporter: Shengdi
>            Priority: Minor
>
> I used 
> SshServer sshd = SshServer.setUpDefaultServer(); to start an sshd server.
>  
> When I connect to server with several terminals, and then I keep connect with 
> other terminals, then I can probably find the additional ones. This is 
> randomly, and most happens after multiple connecting simultaneously or very 
> close, then other connect will cause additional connection
> Here is an example,
> I connect with 5 terminals very closely, i found 5 connections with netstat, 
> this is correct
>  TCP 127.0.0.1:63862 127.0.0.1:12399 ESTABLISHED 44444
>  TCP 127.0.0.1:63864 127.0.0.1:12399 ESTABLISHED 42764
>  TCP 127.0.0.1:63868 127.0.0.1:12399 ESTABLISHED 47036
>  TCP 127.0.0.1:63874 127.0.0.1:12399 ESTABLISHED 42516
>  TCP 127.0.0.1:63879 127.0.0.1:12399 ESTABLISHED 41704
> But then connect one more time, then i found two connection established this 
> time, 
> TCP 127.0.0.1:63862 127.0.0.1:12399 ESTABLISHED 44444
>  TCP 127.0.0.1:63864 127.0.0.1:12399 ESTABLISHED 42764
>  TCP 127.0.0.1:63868 127.0.0.1:12399 ESTABLISHED 47036
>  TCP 127.0.0.1:63874 127.0.0.1:12399 ESTABLISHED 42516
>  TCP 127.0.0.1:63879 127.0.0.1:12399 ESTABLISHED 41704
>  {color:#ff0000}TCP 127.0.0.1:63890 127.0.0.1:12399 ESTABLISHED 35316{color}
>  {color:#ff0000} TCP 127.0.0.1:63891 127.0.0.1:12399 ESTABLISHED 22568{color}
>  
> Does anyone have any idea about this? how the additional connection caused?
> Great Thanks
>  
> Cheers
> Shengdi
>  
>  
> ==================================================
> Following is my code example
> ==================================================
> public class SSHServer {
>  private SshServer sshd;
>  public SSHServer() {
>  sshd = SshServer.setUpDefaultServer();
>  }
>  public void start() throws IOException {
>  sshd.setHost("127.0.0.1");
>  sshd.setPort(12399);
>  sshd.setKeyPairProvider(new MyKeyProvider());
>  sshd.setShellFactory(getShellFactory());
>  sshd.setPublickeyAuthenticator(new MyAuthenticator());
>  sshd.getProperties().put(SshServer.IDLE_TIMEOUT, String.valueOf(300000));
>  // Start SSH server
>  sshd.start();
>  }
>  private Factory<Command> getShellFactory() {
>  return new Factory<Command>() {
>  @Override
>  public Command create() {
>  return new MyShell();
>  }
>  };
>  }
> }
>  



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

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

Reply via email to