Add workaround for connection problems with IPv6 link-local addresses and jdk < 7. See #267
This commit is contained in:
parent
3558eb7042
commit
5a2793e317
|
@ -35,7 +35,13 @@ public final class SocketUtil {
|
|||
*
|
||||
*/
|
||||
public static InetSocketAddress stripZoneId(InetSocketAddress socketAddress) throws UnknownHostException {
|
||||
return new InetSocketAddress(socketAddress.getAddress(), socketAddress.getPort());
|
||||
// If we have a java version which is >= 7 we can just return the given
|
||||
// InetSocketAddress as this bug only seems
|
||||
// to exist in java 6 (and maybe also versions before)
|
||||
if (DetectionUtil.javaVersion() >= 7) {
|
||||
return socketAddress;
|
||||
}
|
||||
return new InetSocketAddress(stripZoneId(socketAddress.getAddress()), socketAddress.getPort());
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in New Issue
Block a user