mirror of
https://github.com/vanitasvitae/Smack.git
synced 2024-11-29 07:22:07 +01:00
Do not re-use the Socket after connect() failed
Fixes SMACK-724.
This commit is contained in:
parent
1f87185ee8
commit
fb55b9065f
1 changed files with 4 additions and 0 deletions
|
@ -579,6 +579,10 @@ public class XMPPTCPConnection extends AbstractXMPPConnection {
|
|||
throw new UnknownHostException(host);
|
||||
}
|
||||
innerloop: while (inetAddresses.hasNext()) {
|
||||
// Create a *new* Socket before every connection attempt, i.e. connect() call, since Sockets are not
|
||||
// re-usable after a failed connection attempt. See also SMACK-724.
|
||||
socket = socketFactory.createSocket();
|
||||
|
||||
final InetAddress inetAddress = inetAddresses.next();
|
||||
final String inetAddressAndPort = inetAddress + " at port " + port;
|
||||
LOGGER.finer("Trying to establish TCP connection to " + inetAddressAndPort);
|
||||
|
|
Loading…
Reference in a new issue