Add 'src/be/nikiroo/utils/' from commit '46add0670fdee4bd936a13fe2448c5e20a7ffd0a'
[fanfix.git] / src / be / nikiroo / utils / serial / server / ConnectActionClient.java
index c56dddd0a727b869f58cec1ce37f6a23c2d2be0f..cb6bef3988c94e8f07d0306a8714ff85f3a9b1d8 100644 (file)
@@ -23,22 +23,8 @@ abstract class ConnectActionClient {
        protected ConnectAction action;
 
        /**
-        * Create a new {@link ConnectActionClient} with the current application
-        * version (see {@link Version#getCurrentVersion()}) as the client version.
-        * 
-        * @param s
-        *            the socket to bind to
-        * @param key
-        *            an optional key to encrypt all the communications (if NULL,
-        *            everything will be sent in clear text)
-        */
-       public ConnectActionClient(Socket s, String key) {
-               this(s, key, Version.getCurrentVersion());
-       }
-
-       /**
-        * Create a new {@link ConnectActionClient} with the current application
-        * version (see {@link Version#getCurrentVersion()}) as the client version.
+        * Create a new {@link ConnectActionClient}, using the current version of
+        * the program.
         * 
         * @param host
         *            the host to bind to
@@ -48,6 +34,7 @@ abstract class ConnectActionClient {
         *            an optional key to encrypt all the communications (if NULL,
         *            everything will be sent in clear text)
         * 
+        * 
         * @throws IOException
         *             in case of I/O error
         * @throws UnknownHostException
@@ -58,7 +45,7 @@ abstract class ConnectActionClient {
         */
        public ConnectActionClient(String host, int port, String key)
                        throws IOException {
-               this(new Socket(host, port), key, Version.getCurrentVersion());
+               this(host, port, key, Version.getCurrentVersion());
        }
 
        /**
@@ -71,9 +58,10 @@ abstract class ConnectActionClient {
         * @param key
         *            an optional key to encrypt all the communications (if NULL,
         *            everything will be sent in clear text)
-        * @param version
+        * @param clientVersion
         *            the client version
         * 
+        * 
         * @throws IOException
         *             in case of I/O error
         * @throws UnknownHostException
@@ -83,8 +71,22 @@ abstract class ConnectActionClient {
         *             port values, which is between 0 and 65535, inclusive
         */
        public ConnectActionClient(String host, int port, String key,
-                       Version version) throws IOException {
-               this(new Socket(host, port), key, version);
+                       Version clientVersion) throws IOException {
+               this(new Socket(host, port), key, clientVersion);
+       }
+
+       /**
+        * Create a new {@link ConnectActionClient}, using the current version of
+        * the program.
+        * 
+        * @param s
+        *            the socket to bind to
+        * @param key
+        *            an optional key to encrypt all the communications (if NULL,
+        *            everything will be sent in clear text)
+        */
+       public ConnectActionClient(Socket s, String key) {
+               this(s, key, Version.getCurrentVersion());
        }
 
        /**
@@ -95,11 +97,11 @@ abstract class ConnectActionClient {
         * @param key
         *            an optional key to encrypt all the communications (if NULL,
         *            everything will be sent in clear text)
-        * @param version
+        * @param clientVersion
         *            the client version
         */
-       public ConnectActionClient(Socket s, String key, Version version) {
-               action = new ConnectAction(s, false, key, version) {
+       public ConnectActionClient(Socket s, String key, Version clientVersion) {
+               action = new ConnectAction(s, false, key, clientVersion) {
                        @Override
                        protected void action(Version serverVersion) throws Exception {
                                ConnectActionClient.this.action(serverVersion);
@@ -142,7 +144,7 @@ abstract class ConnectActionClient {
         * Method that will be called when an action is performed on the client.
         * 
         * @param serverVersion
-        *            the server version
+        *            the version of the server connected to this client
         * 
         * @throws Exception
         *             in case of I/O error