mirror of
https://github.com/eclipse-sailing-analytics/sailing-analytics.git
synced 2026-10-08 13:20:57 +00:00
first GWT-enabled WebSockets round-trip in a little toy sample
This commit is contained in:
1 parent
96ce6aa75b
commit
72121e03a1
1 file changed
+5
-5
+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
|
||||
|
||||
Reference in new issue
Block a user