diff options
author | Kenny Root <kenny@the-b.org> | 2015-10-08 09:57:51 -0700 |
---|---|---|
committer | Kenny Root <kenny@the-b.org> | 2015-10-08 11:25:35 -0700 |
commit | bd9f683112c37baef10fd5514ec2dfd571d0c0dc (patch) | |
tree | e6b0641b1a95187628634a118b8ad5a53643b5ee /sshlib/src/main/java/com/trilead/ssh2/ProxyData.java | |
parent | 0c73789e89238324ddcb233bda972c48ac94a1e2 (diff) | |
download | sshlib-bd9f683112c37baef10fd5514ec2dfd571d0c0dc.tar.gz sshlib-bd9f683112c37baef10fd5514ec2dfd571d0c0dc.tar.bz2 sshlib-bd9f683112c37baef10fd5514ec2dfd571d0c0dc.zip |
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.
Diffstat (limited to 'sshlib/src/main/java/com/trilead/ssh2/ProxyData.java')
-rw-r--r-- | sshlib/src/main/java/com/trilead/ssh2/ProxyData.java | 17 |
1 files changed, 15 insertions, 2 deletions
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; } |