diff options
author | Artur Signell <artur@vaadin.com> | 2013-09-12 20:57:01 +0300 |
---|---|---|
committer | Vaadin Code Review <review@vaadin.com> | 2013-10-04 10:09:44 +0000 |
commit | 633b4e858c31769f4b8848c934651da1d54b2721 (patch) | |
tree | 4fa049b4a84ff0c41a4dadbadea9190dee8bd3d4 /client | |
parent | 07ca622a6b2edcf7a253762cf222155bdf460a88 (diff) | |
download | vaadin-framework-633b4e858c31769f4b8848c934651da1d54b2721.tar.gz vaadin-framework-633b4e858c31769f4b8848c934651da1d54b2721.zip |
Prepare for Atmosphere Javascript 2.0 (#12241)
* Atmosphere 2.0 has changed enableProtocol to default to true.
* Reopening a connection in Atmosphere 2.0 is signalled through an onReopen event (not present at all in Atmosphere 1.0.x)
Fix was backported from master
Change-Id: I6ed258087a0b3a06440ab9d19b621560fa4f998f
Merge: no
Diffstat (limited to 'client')
-rw-r--r-- | client/src/com/vaadin/client/communication/AtmospherePushConnection.java | 24 |
1 files changed, 22 insertions, 2 deletions
diff --git a/client/src/com/vaadin/client/communication/AtmospherePushConnection.java b/client/src/com/vaadin/client/communication/AtmospherePushConnection.java index 3cecb09dc1..8bddd78688 100644 --- a/client/src/com/vaadin/client/communication/AtmospherePushConnection.java +++ b/client/src/com/vaadin/client/communication/AtmospherePushConnection.java @@ -228,10 +228,26 @@ public class AtmospherePushConnection implements PushConnection { return config; } - protected void onOpen(AtmosphereResponse response) { - transport = response.getTransport(); + protected void onReopen(AtmosphereResponse response) { + VConsole.log("Push connection re-established using " + transport); + onConnect(response); + } + protected void onOpen(AtmosphereResponse response) { VConsole.log("Push connection established using " + transport); + onConnect(response); + } + + /** + * Called whenever a server push connection is established (or + * re-established). + * + * @param response + * + * @since 7.2 + */ + protected void onConnect(AtmosphereResponse response) { + transport = response.getTransport(); switch (state) { case CONNECT_PENDING: @@ -422,6 +438,7 @@ public class AtmospherePushConnection implements PushConnection { reconnectInterval: 5000, maxReconnectOnClose: 10000000, trackMessageLength: true, + enableProtocol: false, messageDelimiter: String.fromCharCode(@com.vaadin.shared.communication.PushConstants::MESSAGE_DELIMITER) }; }-*/; @@ -435,6 +452,9 @@ public class AtmospherePushConnection implements PushConnection { config.onOpen = $entry(function(response) { self.@com.vaadin.client.communication.AtmospherePushConnection::onOpen(*)(response); }); + config.onReopen = $entry(function(response) { + self.@com.vaadin.client.communication.AtmospherePushConnection::onReopen(*)(response); + }); config.onMessage = $entry(function(response) { self.@com.vaadin.client.communication.AtmospherePushConnection::onMessage(*)(response); }); |