From bd9f683112c37baef10fd5514ec2dfd571d0c0dc Mon Sep 17 00:00:00 2001 From: Kenny Root Date: Thu, 8 Oct 2015 09:57:51 -0700 Subject: Move socket creation out to its own function Newer proxy types will need to have a way to create their own sockets, so move this out to its own function to allow that later. --- sshlib/src/main/java/com/trilead/ssh2/ProxyData.java | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) (limited to 'sshlib/src/main/java/com/trilead/ssh2/ProxyData.java') diff --git a/sshlib/src/main/java/com/trilead/ssh2/ProxyData.java b/sshlib/src/main/java/com/trilead/ssh2/ProxyData.java index 059a6e3..864d7a0 100644 --- a/sshlib/src/main/java/com/trilead/ssh2/ProxyData.java +++ b/sshlib/src/main/java/com/trilead/ssh2/ProxyData.java @@ -1,8 +1,11 @@ package com.trilead.ssh2; +import java.io.IOException; +import java.net.Socket; + /** - * An abstract marker interface implemented by all proxy data implementations. + * An abstract interface implemented by all proxy data implementations. * * @see HTTPProxyData * @@ -10,6 +13,16 @@ package com.trilead.ssh2; * @version $Id: ProxyData.java,v 1.1 2007/10/15 12:49:56 cplattne Exp $ */ -public abstract interface ProxyData +public interface ProxyData { + /** + * Connects the socket to the given destination using the proxy method that this instance + * represents. + * @param hostname hostname of end host (not proxy) + * @param port port of end host (not proxy) + * @param connectTimeout number of seconds before giving up on connecting to end host + * @throws IOException if the connection could not be completed + * @return connected socket instance + */ + Socket openConnection(String hostname, int port, int connectTimeout) throws IOException; } -- cgit v1.2.3