-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Closed
Labels
Milestone
Description
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