Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

UDP->WebSocket relay "clogs up" #217

Open
the-drunk-coder opened this issue Aug 25, 2024 · 5 comments
Open

UDP->WebSocket relay "clogs up" #217

the-drunk-coder opened this issue Aug 25, 2024 · 5 comments

Comments

@the-drunk-coder
Copy link

Hi,

I set up a UPD to WebSocket relay to receive OSC messages in the browser.

On the node side (using express.js as an application framework):


// Bind to a UDP socket to listen for incoming OSC events.
var udpPort = new osc.UDPPort({
    localAddress: "0.0.0.0",
    localPort: 57121
});
 [...]
wss.on("connection", function (socket) {
    console.log("A Web Socket connection has been established!");
    var socketPort = new osc.WebSocketPort({
        socket: socket
    });

    var relay = new osc.Relay(udpPort, socketPort, {
        raw: true
    });
});

and on the browser side:

var oscPort = new osc.WebSocketPort({
    url: "ws://localhost:8081", // URL to your Web Socket server.
    metadata: true
});

oscPort.open();

oscPort.on("message", function (msg) { ... });

It works as long as I'm not sending too many (sequential) messages.

The problem is, I'm sending out about a 1000 messages (957 to be precise), but only about 800 arrive on the browser side, so something seems to get "clogged up".

If I start an OSC reciever with oscdump, I can see all the messages arriving, so I don't thing it's a problem with my sending application.

Is there some flags I could tweak to be able to achieve a higher throughput ?

Best,
n

@the-drunk-coder
Copy link
Author

@AlecsSantos can you tell me what it is, before I click a random link to a cloud storage?

Repository owner deleted a comment Aug 25, 2024
Repository owner deleted a comment Aug 25, 2024
@colinbdclark
Copy link
Owner

@AlecsSantos can you tell me what it is, before I click a random link to a cloud storage?

This is likely malware; I've deleted the comments from this user and reported.

@colinbdclark
Copy link
Owner

@the-drunk-coder, I realized I never did respond to your issue here, I was on vacation and distracted by the malware response you received.

Off the top of my head, I'm not sure what the issue you're facing is. In theory, I don't think it's likely to be an issue with the osc.js library directly—but in practice, who knows? As a protocol, UDP doesn't guarantee that all packets will be received, so if the issue is just arbitrarily lost packets, using TCP instead might provide you with greater certainty (at the cost of potentially higher latency).

Have you had any luck in further diagnosing the issue?

@the-drunk-coder
Copy link
Author

Hi, I haven't really found anything "actionable", ultimately I split up the messages I sent into various batches as a workaround ...

@colinbdclark
Copy link
Owner

Thanks for responding! That seems like a reasonable workaround.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants