Skip to content

What can I do to intercept ws #9776

Answered by msujew
zzkkui asked this question in Q&A
Jul 26, 2021 · 1 comments · 6 replies
Discussion options

You must be logged in to vote

Hi @zzkkui thank you for your question,

I assume the resources you want to release are on the backend? Correct me if I'm wrong there. So basically, the MessagingContribution will call terminate on the web socket once it doesn't answer for 30 seconds. See here:

setInterval(() => {
this.webSocketServer!.clients.forEach((socket: CheckAliveWS) => {
if (socket.alive === false) {
socket.terminate();
return;
}
socket.alive = false;
socket.ping();
});

In order to use that to release your resources, you will have to add your own function to the onClose

Replies: 1 comment 6 replies

Comment options

You must be logged in to vote
6 replies
@msujew
Comment options

@zzkkui
Comment options

@msujew
Comment options

@zzkkui
Comment options

@msujew
Comment options

Answer selected by zzkkui
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants