From 0f5831df6f2a4bf31d4ca0a45e14662c8d172ef2 Mon Sep 17 00:00:00 2001 From: Leif Åstrand Date: Fri, 3 May 2013 11:44:11 +0300 Subject: Update state before purging outgoing queue (#11768) Change-Id: I83ad088da0aa173e5e912b9059757274526d5c25 --- .../vaadin/client/communication/AtmospherePushConnection.java | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'client') diff --git a/client/src/com/vaadin/client/communication/AtmospherePushConnection.java b/client/src/com/vaadin/client/communication/AtmospherePushConnection.java index e42f91ea67..bc7e0b3fd2 100644 --- a/client/src/com/vaadin/client/communication/AtmospherePushConnection.java +++ b/client/src/com/vaadin/client/communication/AtmospherePushConnection.java @@ -220,14 +220,13 @@ public class AtmospherePushConnection implements PushConnection { VConsole.log("Push connection established using " + transport); - for (String message : messageQueue) { - push(message); - } - messageQueue.clear(); - switch (state) { case CONNECT_PENDING: state = State.CONNECTED; + for (String message : messageQueue) { + push(message); + } + messageQueue.clear(); break; case DISCONNECT_PENDING: // Set state to connected to make disconnect close the connection -- cgit v1.2.3