X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?p=controller.git;a=blobdiff_plain;f=opendaylight%2Fnetconf%2Fnetconf-netty-util%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fnetconf%2Fnettyutil%2Fhandler%2Fssh%2Fclient%2FAsyncSshHandler.java;fp=opendaylight%2Fnetconf%2Fnetconf-netty-util%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fnetconf%2Fnettyutil%2Fhandler%2Fssh%2Fclient%2FAsyncSshHandler.java;h=c89da4984a409c507a3c2644ed0671b7a1f4daba;hp=064ae72bc7c512db762a45007a73e9aeebebbe45;hb=f072dac62db940562d03b5829fa1f4fd3ef74c54;hpb=34e38a415bc299403657315a5b61afd432dcbbee diff --git a/opendaylight/netconf/netconf-netty-util/src/main/java/org/opendaylight/controller/netconf/nettyutil/handler/ssh/client/AsyncSshHandler.java b/opendaylight/netconf/netconf-netty-util/src/main/java/org/opendaylight/controller/netconf/nettyutil/handler/ssh/client/AsyncSshHandler.java index 064ae72bc7..c89da4984a 100644 --- a/opendaylight/netconf/netconf-netty-util/src/main/java/org/opendaylight/controller/netconf/nettyutil/handler/ssh/client/AsyncSshHandler.java +++ b/opendaylight/netconf/netconf-netty-util/src/main/java/org/opendaylight/controller/netconf/nettyutil/handler/ssh/client/AsyncSshHandler.java @@ -15,6 +15,7 @@ import io.netty.channel.ChannelOutboundHandlerAdapter; import io.netty.channel.ChannelPromise; import java.io.IOException; import java.net.SocketAddress; +import java.util.HashMap; import org.apache.sshd.ClientChannel; import org.apache.sshd.ClientSession; import org.apache.sshd.SshClient; @@ -39,7 +40,16 @@ public class AsyncSshHandler extends ChannelOutboundHandlerAdapter { public static final int SSH_DEFAULT_NIO_WORKERS = 8; + // Disable default timeouts from mina sshd + private static final long DEFAULT_TIMEOUT = -1L; + static { + DEFAULT_CLIENT.setProperties(new HashMap(){ + { + put(SshClient.AUTH_TIMEOUT, Long.toString(DEFAULT_TIMEOUT)); + put(SshClient.IDLE_TIMEOUT, Long.toString(DEFAULT_TIMEOUT)); + } + }); // TODO make configurable, or somehow reuse netty threadpool DEFAULT_CLIENT.setNioWorkers(SSH_DEFAULT_NIO_WORKERS); DEFAULT_CLIENT.start();