diff options
author | Benoit Foucher <benoit@zeroc.com> | 2013-01-15 18:46:12 +0100 |
---|---|---|
committer | Benoit Foucher <benoit@zeroc.com> | 2013-01-15 18:46:12 +0100 |
commit | f561241d76b7a3d58a8652a8ae6642361f6d596b (patch) | |
tree | 06602625807c74e6476043eee42f304e15609592 /java/src/IceInternal/Protocol.java | |
parent | Fixed(ICE-5184) -IceGridGUI will not allow me to enter port in connection cre... (diff) | |
download | ice-f561241d76b7a3d58a8652a8ae6642361f6d596b.tar.bz2 ice-f561241d76b7a3d58a8652a8ae6642361f6d596b.tar.xz ice-f561241d76b7a3d58a8652a8ae6642361f6d596b.zip |
Fixed ICE-5131 - parsing of -p <version> for proxies, tweaked UDP endpoint deprecation warning for -v/-e
Diffstat (limited to 'java/src/IceInternal/Protocol.java')
-rw-r--r-- | java/src/IceInternal/Protocol.java | 27 |
1 files changed, 26 insertions, 1 deletions
diff --git a/java/src/IceInternal/Protocol.java b/java/src/IceInternal/Protocol.java index e1e88ce3511..e90a33bd64a 100644 --- a/java/src/IceInternal/Protocol.java +++ b/java/src/IceInternal/Protocol.java @@ -131,11 +131,36 @@ final public class Protocol } // + // Either return the given protocol if not compatible, or the greatest + // supported protocol otherwise. + // + static public Ice.ProtocolVersion + getCompatibleProtocol(Ice.ProtocolVersion v) + { + if(v.major != currentProtocol.major) + { + return v; // Unsupported protocol, return as is. + } + else if(v.minor < currentProtocol.minor) + { + return v; // Supported protocol. + } + else + { + // + // Unsupported but compatible, use the currently supported + // protocol, that's the best we can do. + // + return currentProtocol; + } + } + + // // Either return the given encoding if not compatible, or the greatest // supported encoding otherwise. // static public Ice.EncodingVersion - checkForCompatibleEncoding(Ice.EncodingVersion v) + getCompatibleEncoding(Ice.EncodingVersion v) { if(v.major != currentEncoding.major) { |