static { registerSmackProviders(); DNSUtil.setDNSResolver(DNSJavaResolver.getInstance()); // initialize smack defaults before any connections are created SmackConfiguration.setPacketReplyTimeout(PACKET_TIMEOUT); SmackConfiguration.setDefaultPingInterval(0); }
private boolean checkIfPrivacyIsSupported(XMPPConnection conn) { ServiceDiscoveryManager servDisc = ServiceDiscoveryManager.getInstanceFor(conn); DiscoverInfo info = null; try { String xmppHost = DNSUtil.resolveXMPPDomain(conn.getServiceName()).getHost(); info = servDisc.discoverInfo(xmppHost); } catch (XMPPException e) { // We could not query the server return false; } if (info != null) { for (Iterator<Feature> i = info.getFeatures(); i.hasNext(); ) { String s = i.next().getVar(); if (s.contains("jabber:iq:privacy")) { return true; } } } return false; }
void maybeResolveDns() throws Exception { if (!useDnsSrvRr) return; hostAddresses = DNSUtil.resolveXMPPDomain(serviceName); }
static { registerSmackProviders(); DNSUtil.setDNSResolver(DNSJavaResolver.getInstance()); SmackConfiguration.setPacketReplyTimeout(PACKET_TIMEOUT); SmackConfiguration.setDefaultPingInterval(0); }