1
0
Fork 0
mirror of https://codeberg.org/Mercury-IM/Smack synced 2024-12-22 20:47:57 +01:00

Only create the socket once

in XMPPTCPConnection.connectUsingConfiguration().
This commit is contained in:
Florian Schmaus 2016-01-10 18:24:01 +01:00
parent ac0c05be04
commit 7845f21465

View file

@ -545,11 +545,11 @@ public class XMPPTCPConnection extends AbstractXMPPConnection {
if (socketFactory == null) {
socketFactory = SocketFactory.getDefault();
}
socket = socketFactory.createSocket();
for (HostAddress hostAddress : hostAddresses) {
Iterator<InetAddress> inetAddresses = null;
String host = hostAddress.getFQDN();
int port = hostAddress.getPort();
socket = socketFactory.createSocket();
try {
inetAddresses = Arrays.asList(InetAddress.getAllByName(host)).iterator();
if (!inetAddresses.hasNext()) {