Package org.jivesoftware.smack

Examples of org.jivesoftware.smack.PacketCollector.cancel()


        connection.sendPacket(agentInfo);

        AgentInfo response = (AgentInfo)collector.nextResult(SmackConfiguration.getPacketReplyTimeout());

        // Cancel the collector.
        collector.cancel();
        if (response == null) {
            throw new XMPPException("No response from server on status set.");
        }
        if (response.getError() != null) {
            throw new XMPPException(response.getError());
View Full Code Here


        connection.sendPacket(agentInfo);

        IQ response = (IQ)collector.nextResult(SmackConfiguration.getPacketReplyTimeout());

        // Cancel the collector.
        collector.cancel();
        if (response == null) {
            throw new XMPPException("No response from server on status set.");
        }
        if (response.getError() != null) {
            throw new XMPPException(response.getError());
View Full Code Here

        STUN response = (STUN) collector
                .nextResult(SmackConfiguration.getPacketReplyTimeout());

        // Cancel the collector.
        collector.cancel();

        return response;
    }

    /**
 
View Full Code Here

        con.sendPacket(activity);

        LastActivity response = (LastActivity) collector.nextResult(SmackConfiguration.getPacketReplyTimeout());

        // Cancel the collector.
        collector.cancel();
        if (response == null) {
            throw new XMPPException("No response from server on status set.");
        }
        if (response.getError() != null) {
            throw new XMPPException(response.getError());
View Full Code Here

        connection.sendPacket(this);

        Packet response = collector.nextResult(SmackConfiguration.getPacketReplyTimeout());

        // Cancel the collector.
        collector.cancel();
        if (response == null) {
            throw new XMPPException("No response from server on status set.");
        }
        if (response.getError() != null) {
            throw new XMPPException(response.getError());
View Full Code Here

        connection.sendPacket(reg);
        IQ result = (IQ) collector.nextResult(SmackConfiguration
            .getPacketReplyTimeout());

        // Stop queuing results
        collector.cancel();

        if (result == null) {
            // TODO This exception is shown incorrectly to the user!!
            throw new XMPPException("No response from server.");
        } else if (result.getType() == IQ.Type.ERROR) {
View Full Code Here

        getConnection(0).sendPacket(version);

        // Wait up to 5 seconds for a result.
        IQ result = (IQ)collector.nextResult(5000);
        // Close the collector
        collector.cancel();

        assertNotNull("No result from the server", result);

        assertEquals("Incorrect result type", IQ.Type.RESULT, result.getType());
        assertNotNull("No name specified in the result", ((Version)result).getName());
View Full Code Here

        // Wait up to a certain number of seconds for a reply.
        Packet result = response.nextResult(timeout);

        // Stop queuing results
        response.cancel();

        if (result == null) {
            throw new XMPPException("No response from server.");
        }
        else if (result.getError() != null) {
View Full Code Here

    // Receive the packet
    IQ iqReceived = (IQ)collector.nextResult(SmackConfiguration.getPacketReplyTimeout());

    // Stop queuing results
    collector.cancel();

    if (iqReceived == null) {
      fail("No response from server");
    }
    else if (iqReceived.getType() == IQ.Type.ERROR) {
View Full Code Here

                            + response.dataHash + " expected==" + localDataHash);

                result.mode = response.transferMode;

            } finally {
                collector.cancel();
            }

        } finally {
            progress.done();
        }
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.