X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;f=opendaylight%2Fnetconf%2Fnetconf-ssh%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fnetconf%2Fssh%2FNetconfSSHServer.java;fp=opendaylight%2Fnetconf%2Fnetconf-ssh%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fnetconf%2Fssh%2FNetconfSSHServer.java;h=dad149fd60b762704fbf4c5f4d79882c51b8b676;hb=d82b96055d2c0d471c85c2b2b3cb30e52fff1c69;hp=0000000000000000000000000000000000000000;hpb=b2d4575c4425e3b3d5aeaf1190e01e5d5a5286aa;p=controller.git diff --git a/opendaylight/netconf/netconf-ssh/src/main/java/org/opendaylight/controller/netconf/ssh/NetconfSSHServer.java b/opendaylight/netconf/netconf-ssh/src/main/java/org/opendaylight/controller/netconf/ssh/NetconfSSHServer.java new file mode 100644 index 0000000000..dad149fd60 --- /dev/null +++ b/opendaylight/netconf/netconf-ssh/src/main/java/org/opendaylight/controller/netconf/ssh/NetconfSSHServer.java @@ -0,0 +1,32 @@ +/* + * Copyright (c) 2013 Cisco Systems, Inc. and others. All rights reserved. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License v1.0 which accompanies this distribution, + * and is available at http://www.eclipse.org/legal/epl-v10.html + */ +package org.opendaylight.controller.netconf.ssh; + +import java.net.ServerSocket; + +public class NetconfSSHServer { + + private static boolean acceptMore = true; + private static final int SERVER_PORT = 830; + private ServerSocket ss = null; + + private NetconfSSHServer() throws Exception{ + this.ss = new ServerSocket(SERVER_PORT); + while (acceptMore) { + SocketThread.start(ss.accept()); + } + } + public static NetconfSSHServer start() throws Exception { + return new NetconfSSHServer(); + } + + public void stop() throws Exception { + ss.close(); + } + +}