mirror of
https://codeberg.org/Mercury-IM/Smack
synced 2024-11-22 06:12:05 +01:00
Only create the socket once
in XMPPTCPConnection.connectUsingConfiguration().
This commit is contained in:
parent
ac0c05be04
commit
7845f21465
1 changed files with 1 additions and 1 deletions
|
@ -545,11 +545,11 @@ public class XMPPTCPConnection extends AbstractXMPPConnection {
|
||||||
if (socketFactory == null) {
|
if (socketFactory == null) {
|
||||||
socketFactory = SocketFactory.getDefault();
|
socketFactory = SocketFactory.getDefault();
|
||||||
}
|
}
|
||||||
|
socket = socketFactory.createSocket();
|
||||||
for (HostAddress hostAddress : hostAddresses) {
|
for (HostAddress hostAddress : hostAddresses) {
|
||||||
Iterator<InetAddress> inetAddresses = null;
|
Iterator<InetAddress> inetAddresses = null;
|
||||||
String host = hostAddress.getFQDN();
|
String host = hostAddress.getFQDN();
|
||||||
int port = hostAddress.getPort();
|
int port = hostAddress.getPort();
|
||||||
socket = socketFactory.createSocket();
|
|
||||||
try {
|
try {
|
||||||
inetAddresses = Arrays.asList(InetAddress.getAllByName(host)).iterator();
|
inetAddresses = Arrays.asList(InetAddress.getAllByName(host)).iterator();
|
||||||
if (!inetAddresses.hasNext()) {
|
if (!inetAddresses.hasNext()) {
|
||||||
|
|
Loading…
Reference in a new issue