I'm trying to connect my Java client to Node.js server on Heroku via Jetty websockets, but there is no connection. @OnWebSocketConnect method doesn't execute.
WebSocketClient client = new WebSocketClient();
SimpleEchoSocket socket = new SimpleEchoSocket();
try {
client.start();
URI echoUri = new URI(destUri);
ClientUpgradeRequest request = new ClientUpgradeRequest();
client.connect(socket, echoUri, request);
socket.awaitClose(50, TimeUnit.SECONDS);
} catch (Throwable t) {
t.printStackTrace();
} finally {
try {
client.stop();
} catch (Exception e) {
e.printStackTrace();
}
}
Aucun commentaire:
Enregistrer un commentaire