Currently, I am utilizing Websocket Rxjs within my application. The connection is successfully established with the server, and upon subscribing to it, all data is received in an array format. However, when attempting to send data back to the server, it seems to not go through; instead, it gets stored in the buffer array of the destination object of the websocket observable (refer to the screenshot below). Additionally, I have included a snippet of the code for reference.
import { webSocket } from 'rxjs/webSocket';
const subject = webSocket('ws://localhost:8081');
subject.subscribe({
next: msg => console.log('message received: ' + msg),
error: err => console.log(err),
complete: () => console.log('complete')
});
// When clicking a button, the following is sent to the sever (as shown in the screenshot).
subject.next({
"action" : "read",
"id" : 1595
});
https://i.sstatic.net/DztlE.jpg
Although my connection remains active, the issue persists. The connection does not close, yet the problem still stands. Could this be related to the backend? If so, what could potentially be causing this to occur? Any guidance or solutions would be greatly appreciated. Thank you! :)