/** * Sets the number of milliseconds to wait for a response from * the server. * * @param timeout the milliseconds to wait for a response from the server * @deprecated use {@link #setDefaultReplyTimeout(int)} instead. */ @Deprecated public static void setDefaultPacketReplyTimeout(int timeout) { setDefaultReplyTimeout(timeout); }
SmackConfiguration.setDefaultReplyTimeout(config.replyTimeout);
@Test(expected = SmackException.class) public void getConfigFormWithTimeout() throws XMPPException, SmackException, InterruptedException { ThreadedDummyConnection con = new ThreadedDummyConnection(); PubSubManager mgr = new PubSubManager(con, PubSubManagerTest.DUMMY_PUBSUB_SERVICE); DiscoverInfo info = new DiscoverInfo(); Identity ident = new Identity("pubsub", null, "leaf"); info.addIdentity(ident); con.addIQReply(info); Node node = mgr.getNode("princely_musings"); SmackConfiguration.setDefaultReplyTimeout(100); con.setTimeout(); node.getNodeConfiguration(); }
/** * Sets the number of milliseconds to wait for a response from * the server. * * @param timeout the milliseconds to wait for a response from the server * @deprecated use {@link #setDefaultReplyTimeout(int)} instead. */ @Deprecated public static void setDefaultPacketReplyTimeout(int timeout) { setDefaultReplyTimeout(timeout); }
@Override public void start(BundleContext bundleContext) throws Exception { XmppProtocolActivator.bundleContext = bundleContext; SmackConfiguration.setDefaultReplyTimeout(15000); // if there is a parsing error, do not break the connection to // the server(the default behaviour) as we need it for // the other conferences SmackConfiguration.setDefaultParsingExceptionCallback( new ExceptionLoggingCallback()); Socks5Proxy.setLocalSocks5ProxyEnabled(false); registerXmppExtensions(); XmppProviderFactory focusFactory = new XmppProviderFactory( bundleContext, ProtocolNames.JABBER); Hashtable<String, String> hashtable = new Hashtable<>(); // Register XMPP hashtable.put(ProtocolProviderFactory.PROTOCOL, ProtocolNames.JABBER); focusRegistration = bundleContext.registerService( ProtocolProviderFactory.class.getName(), focusFactory, hashtable); }