Examples of nextResult()


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

        PacketCollector collector = client.createPacketCollector(new PacketIDFilter(request.getPacketID()));

        client.sendPacket(request);

        // Wait up to 5 seconds for a result.
        return collector.nextResult(5000);
    }

    private int findFreePort() {
        ServerSocket ss = null;
View Full Code Here

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

    @Override
    protected void onReceiveBeforeRead() throws IOException {
        PacketFilter packetFilter = createPacketFilter();

        PacketCollector collector = connection.createPacketCollector(packetFilter);
        Packet packet = receiveTimeout >= 0 ? collector.nextResult(receiveTimeout) : collector.nextResult();
        if (packet instanceof Message) {
            responseMessage = (Message) packet;
        }
        else if (packet != null) {
            throw new IllegalArgumentException(
View Full Code Here

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

    @Override
    protected void onReceiveBeforeRead() throws IOException {
        PacketFilter packetFilter = createPacketFilter();

        PacketCollector collector = connection.createPacketCollector(packetFilter);
        Packet packet = receiveTimeout >= 0 ? collector.nextResult(receiveTimeout) : collector.nextResult();
        if (packet instanceof Message) {
            responseMessage = (Message) packet;
        }
        else if (packet != null) {
            throw new IllegalArgumentException(
View Full Code Here

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

                testIQ.setTo(readerAddress);
                PacketCollector collector = con.createPacketCollector(new PacketIDFilter(testIQ.getPacketID()));
                con.sendPacket(testIQ);
                // Wait 5 seconds.
                long start = System.currentTimeMillis();
                Packet result = collector.nextResult(5000);
                collector.cancel();
                // If we got a result, continue.
                if (result != null && result.getError() == null) {
                    System.out.println(" found reader. Starting packet flood.");
                    break;
View Full Code Here

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

                new PacketIDFilter(getPacketID()));
        connection.sendPacket(this);

        VCard result = null;
        try {
            result = (VCard) collector.nextResult(SmackConfiguration.getPacketReplyTimeout());

            if (result == null) {
                throw new XMPPException(new XMPPError(408, "Timeout getting VCard information"));
            }
            if (result.getError() != null) {
View Full Code Here

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

              conn.createPacketCollector(new PacketIDFilter(iq.getPacketID()));

          conn.sendPacket(iq);

          // Wait up to 5 seconds for a result.
          IQ result = (IQ) collector.nextResult(SmackConfiguration.getPacketReplyTimeout());
          // Stop queuing results
          collector.cancel();
          if (result == null) {
              throw new XMPPException("No response from the server.");
          }
View Full Code Here

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

    PacketFilter filter = new AndFilter(new PacketIDFilter(reg
        .getPacketID()), new PacketTypeFilter(IQ.class));
    PacketCollector collector = conn
        .createPacketCollector(filter);
    conn.sendPacket(reg);
    IQ result = (IQ) collector.nextResult(SmackConfiguration
        .getPacketReplyTimeout());
    // Stop queuing results
    collector.cancel();
        if (result == null) {
            throw new XMPPException("No response from server.");
View Full Code Here

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

        PacketCollector collector = client.createPacketCollector(new PacketIDFilter(request.getPacketID()));

        client.sendPacket(request);

        // Wait up to 5 seconds for a result.
        return collector.nextResult(5000);
    }

    private int findFreePort() {
        ServerSocket ss = null;
View Full Code Here

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

            PacketCollector collector = getConnection(1).createPacketCollector(
                    new MessageTypeFilter(Message.Type.chat));
            getConnection(1).sendPacket(new Presence(Presence.Type.available));

            // Check that no offline messages was sent to the user
            Message message = (Message) collector.nextResult(2500);
            assertNull("An offline message was sent from the server", message);

            // Delete the retrieved offline messages
            offlineManager.deleteMessages(stamps);
            // Check that there are no offline message for this user
View Full Code Here

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

            PacketCollector collector = getConnection(1).createPacketCollector(
                    new MessageTypeFilter(Message.Type.chat));
            getConnection(1).sendPacket(new Presence(Presence.Type.available));

            // Check that no offline messages was sent to the user
            Message message = (Message) collector.nextResult(2500);
            assertNull("An offline message was sent from the server", message);

            // Delete all offline messages
            offlineManager.deleteMessages();
            // Check that there are no offline message for this user
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.