corrections

This commit is contained in:
2023-12-04 18:33:59 +01:00
parent 4cdde35835
commit 0aa6039f17

View File

@ -9,19 +9,16 @@ export interface OSCMessage {
export let outputSocket = new WebSocket("ws://localhost:3000");
export let inputSocket = new WebSocket("ws://localhost:3001");
// Queue of 1000 last messages
export let oscMessages : any[] = [];
inputSocket.addEventListener('message', (event) => {
let data = JSON.parse(event.data);
if (oscMessages.length > 1000) {
if (oscMessages.length >= 1000) {
oscMessages.shift();
}
oscMessages.push(data);
});
// @ts-ignore
outputSocket.onopen = function (event) {
console.log("Connected to WebSocket Server");