This commit is contained in:
2023-11-22 20:57:51 +01:00
parent ea0c7f3165
commit 565fc60113
2 changed files with 3 additions and 6 deletions

View File

@ -27,12 +27,6 @@ socket.onopen = function (event) {
};
export function sendToServer(message: OSCMessage) {
// Check the port in the message and change port if necessary
if (message.port != parseInt(socket.url.split(":")[2])) {
socket.close();
socket = new WebSocket(`ws://localhost:${message.port}`);
}
if (socket.readyState === WebSocket.OPEN) {
socket.send(JSON.stringify(message));
} else {