first GWT-enabled WebSockets round-trip in a little toy sample

This commit is contained in:
Axel Uhl committed 2013-08-08 18:37:46 +02:00
1 parent 96ce6aa75b
commit 72121e03a1
1 file changed
+5 -5
@@ -151,12 +151,13 @@ public class AdminConsoleEntryPoint extends AbstractEntryPoint implements Regatt
// TODO remove again when testing is done
private void testWebSockets() {
WebSocket webSocket = new JavaScriptWebSocketFactory().createWebSocket(GWT.getModuleBaseURL().replace("http", "ws") + "webSocket", new WebSocketCallback() {
final String baseUrl = GWT.getModuleBaseURL().replace("http", "ws");
int indexOfGwt = baseUrl.indexOf("/gwt/");
String url = baseUrl.substring(0, indexOfGwt)+"/sailingserver/websockettest";
new JavaScriptWebSocketFactory().createWebSocket(url, new WebSocketCallback() {
@Override
public void onOpen(WebSocket webSocket) {
// TODO Auto-generated method stub
webSocket.send("Hallo");
}
@Override
@@ -177,7 +178,6 @@ public class AdminConsoleEntryPoint extends AbstractEntryPoint implements Regatt
}
});
webSocket.send("Hallo");
}
@Override