Browse Source

Updated websocket ts code

ws factory now creates new object on each invocation instead of reusing
websocket
Rohan Sircar 4 years ago
parent
commit
e4041f9e41
  1. 6
      src/main/frontend/chat/main.ts

6
src/main/frontend/chat/main.ts

@ -24,14 +24,12 @@ import { ActiveUserViewModel } from "./viewmodel/ActiveUserViewModel";
// log.setLevel("TRACE");
const chatSocket = new SockJS("/chat");
const chatStompClient = new Client();
chatStompClient.webSocketFactory = () => chatSocket;
chatStompClient.webSocketFactory = () => new SockJS("/chat");
chatStompClient.activate();
const pingSocket = new SockJS("/ping");
const pingStompClient = new Client();
pingStompClient.webSocketFactory = () => pingSocket;
pingStompClient.webSocketFactory = () => new SockJS("/ping");
pingStompClient.activate();
pingStompClient.onConnect = () => {

Loading…
Cancel
Save