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

Only receiving OSC messages once on UDPPort #165

Open
Alzy opened this issue Apr 10, 2020 · 1 comment
Open

Only receiving OSC messages once on UDPPort #165

Alzy opened this issue Apr 10, 2020 · 1 comment

Comments

@Alzy
Copy link

Alzy commented Apr 10, 2020

Hey guys, I'm trying this out on a quick Vue + Electron app and it seems to work well however, I seem to only be receiving packets all at once and then not again. This is how I am initializing :

    // @ is an alias to /src
    import Launcher from '@/components/Launcher.vue'

    var osc = require('osc')

    export default {
      ...

      mounted: function () {
        var oscPort = new osc.UDPPort({
            localAddress: "0.0.0.0",
            localPort: 9000,
            remotePort: 9001,
            metadata: true
        });

        oscPort.open();

        oscPort.on("ready", function () {
            // Listen for incoming OSC messages.
            oscPort.on("message", function (oscMsg, timeTag, info) {
                console.log("An OSC message just arrived!", oscMsg);
                console.log("Remote info is: ", info);
            });

            oscPort.on("error", function (error) {
                console.log("An error occurred (wtf): ", error.message);
            });
        });
        
      }
    }

I seem to be able to receive whatever messages I missed whenever I save the file and triggering BrowserSync to reload the project (effectively rerunning the code in mounted. I wonder if the issue has something to do with BrowserSync(?) it seems unlikely cause BrowserSync operates on port 3000. Any ideas what may be causing the issue? Thanks in advance.

Edit: I have checked to see if maybe the port is being used by another application but it looks like that is not the case. I'm scratching my head as to what could possibly be the issue here.

@colinbdclark
Copy link
Owner

colinbdclark commented Apr 13, 2020

Hi @Alzy, sorry to hear that it not working for you. I can't think of any reason in particular why this code shouldn't work. Without a simplified example or test case, I'm not sure how I can help debug this. It could be an issue with BrowserSync, but I don't know; have you tried without it?

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