Skip to content

UDP->WebSocket relay "clogs up" #217

@the-drunk-coder

Description

@the-drunk-coder

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions