The client (and server) are not supposed to be started multiple times.
This could be improved, but for now, you'd better only call start / stop
once.

2016-03-18 16:45 GMT+01:00 Alexis de Talhouët <adetalho...@inocybe.ca>:

> Hello sshd-dev,
>
> Let say I have an SshClient shared across my app, used to establish
> connection
>  to remote devices. Each time the app is attempting a connection, the
> #start() method
> of SshClient is called. Doing so created a FD leak in the app.
>
> So I’m wondering if by design, the SshClient#start() can be called
> multiple time.
> Else, a quick and easy check in the start method to see if already started
> would
> be an easy fix.
>
> More context:
> [0]: is the static final definition of the SshClient, where the client is
> started the first time
> [1]: and here is where the SshClient is started on each connect attempt
>
> Thanks,
> Alexis
>
> [0]:
> https://github.com/opendaylight/netconf/blob/master/netconf/netconf-netty-util/src/main/java/org/opendaylight/netconf/nettyutil/handler/ssh/client/AsyncSshHandler.java#l46l59
> <
> https://github.com/opendaylight/netconf/blob/master/netconf/netconf-netty-util/src/main/java/org/opendaylight/netconf/nettyutil/handler/ssh/client/AsyncSshHandler.java#l46l59
> >
> [1]:
> https://github.com/opendaylight/netconf/blob/master/netconf/netconf-netty-util/src/main/java/org/opendaylight/netconf/nettyutil/handler/ssh/client/AsyncSshHandler.java#l89
> <
> https://github.com/opendaylight/netconf/blob/master/netconf/netconf-netty-util/src/main/java/org/opendaylight/netconf/nettyutil/handler/ssh/client/AsyncSshHandler.java#l89
> >




-- 
------------------------
Guillaume Nodet
------------------------
Red Hat, Open Source Integration

Email: gno...@redhat.com
Web: http://fusesource.com
Blog: http://gnodet.blogspot.com/

Reply via email to