mirror of
https://codeberg.org/Mercury-IM/Smack
synced 2025-09-10 18:59:41 +02:00
Smack 4.2.1
-----BEGIN PGP SIGNATURE----- iQGTBAABCgB9FiEEl3UFnzoh3OFr5PuuIjmn6PWFIFIFAlmR75tfFIAAAAAALgAo aXNzdWVyLWZwckBub3RhdGlvbnMub3BlbnBncC5maWZ0aGhvcnNlbWFuLm5ldDk3 NzUwNTlGM0EyMURDRTE2QkU0RkJBRTIyMzlBN0U4RjU4NTIwNTIACgkQIjmn6PWF IFLeXggAjdgj7YVUe22NtamnROBj1c3PaWwgSY0gEjcyDPsOz5qeqNUdQLHbmt2j XQQpYZWKg1/1uoQHlsixaFKbGVctKRk72aNEodRfd1osta11WTOwZKEb8nI411Tt 7M0Fhf430WZY6nioZiZIorsmid57fftJ2EMPlmjEDp2FD0AVGAXkEhCneGaPtt9Q hbWbepIy9tApeIH+QgmFLBmPLnFCaSg+X6NUden3Z21bUz5vH8pmcbeUVfsNB7kW nkkDuNwKHPFLgjuhcq7D+KAKRwNU7n8WEuHseRzM7bMCEB+S/rZok5KPXe/tV4v+ YZKN2e+2yh4j5l4FT/fCzELfWcvrgA== =MV3G -----END PGP SIGNATURE----- Merge tag '4.2.1' Smack 4.2.1
This commit is contained in:
commit
43abd52d76
26 changed files with 332 additions and 228 deletions
|
@ -255,7 +255,7 @@ public abstract class AbstractXMPPConnection implements XMPPConnection {
|
|||
private final ExecutorService cachedExecutorService = Executors.newCachedThreadPool(
|
||||
// @formatter:off
|
||||
// CHECKSTYLE:OFF
|
||||
new SmackExecutorThreadFactory( // threadFactory
|
||||
new SmackExecutorThreadFactory(
|
||||
this,
|
||||
"Cached Executor"
|
||||
)
|
||||
|
|
|
@ -41,7 +41,7 @@ public interface StanzaListener {
|
|||
/**
|
||||
* Process the next stanza(/packet) sent to this stanza(/packet) listener.
|
||||
* <p>
|
||||
* A single thread is responsible for invoking all listeners, so
|
||||
* If this listener is synchronous, then a single thread is responsible for invoking all listeners, so
|
||||
* it's very important that implementations of this method not block
|
||||
* for any extended period of time.
|
||||
* </p>
|
||||
|
|
|
@ -75,6 +75,22 @@ public class HostAddress {
|
|||
setException(e);
|
||||
}
|
||||
|
||||
public String getHost() {
|
||||
if (fqdn != null) {
|
||||
return fqdn;
|
||||
}
|
||||
|
||||
// In this case, the HostAddress(int, InetAddress) constructor must been used. We have no FQDN. And
|
||||
// inetAddresses.size() must be exactly one.
|
||||
assert inetAddresses.size() == 1;
|
||||
return inetAddresses.get(0).getHostAddress();
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the fully qualified domain name. This may return <code>null</code> in case there host address is only numeric, i.e. an IP address.
|
||||
*
|
||||
* @return the fully qualified domain name or <code>null</code>
|
||||
*/
|
||||
public String getFQDN() {
|
||||
return fqdn;
|
||||
}
|
||||
|
@ -109,7 +125,7 @@ public class HostAddress {
|
|||
|
||||
@Override
|
||||
public String toString() {
|
||||
return fqdn + ":" + port;
|
||||
return getHost() + ":" + port;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -123,7 +139,7 @@ public class HostAddress {
|
|||
|
||||
final HostAddress address = (HostAddress) o;
|
||||
|
||||
if (!fqdn.equals(address.fqdn)) {
|
||||
if (!getHost().equals(address.getHost())) {
|
||||
return false;
|
||||
}
|
||||
return port == address.port;
|
||||
|
@ -132,7 +148,7 @@ public class HostAddress {
|
|||
@Override
|
||||
public int hashCode() {
|
||||
int result = 1;
|
||||
result = 37 * result + fqdn.hashCode();
|
||||
result = 37 * result + getHost().hashCode();
|
||||
return result * 37 + port;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue