When you use a custom socketFactory this code can be buggy:
if (!socket.isBound()) {
InetSocketAddress addr = new InetSocketAddress(dnsResolver.resolve(uri), this.getPort());
socket.connect(addr, connectTimeout);
}
Indeed socket might already be bound by socketFactory and isBound() will return true. A better version could be
if (!socket.isConnected()) {
InetSocketAddress addr = new InetSocketAddress(dnsResolver.resolve(uri), this.getPort());
socket.connect(addr, connectTimeout);
}
This issue is linked to the solution I mentionned in issue #814
When you use a custom socketFactory this code can be buggy:
Indeed socket might already be bound by socketFactory and isBound() will return true. A better version could be
This issue is linked to the solution I mentionned in issue #814