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

Missing case: pass host, iface and port via constructor options #22

Open
brunoimbrizi opened this issue Apr 13, 2018 · 1 comment
Open

Comments

@brunoimbrizi
Copy link

I am using this library to connect to Elation E-Node 8 II. I was not working with the usage suggested in the readme. After some investigation I noticed the socket had to be bound to a specific port - instead of the default random port assigned by dgram.

If I set host to 2.39.2.202 for example:

// doesn't work
var artnet = require('artnet')({ host: '2.39.2.202' });

The conditional statement between lines 26 and 35 are skipped and the socket is bound to a random port.

If I set iface to my local made up IP address 2.39.2.100:

// works
var artnet = require('artnet')({ iface: '2.39.2.100' });

Then the socket port is set and I can communicate with the E-Node 8 II properly.

but...

If I want to set both host and iface - because I have to communicate with more than one Artnet for example` then it stops working:

// doesn't work
var artnetA = require('artnet')({ iface: '2.39.2.100', host: '2.39.2.202' });
var artnetB = require('artnet')({ iface: '2.39.2.100', host: '2.39.2.203' });
@brunoimbrizi
Copy link
Author

Workaround; create an instance passing only iface and then call setHost() after.

const Artnet = require('artnet');

var artnetA = new Artnet({ iface: '2.39.2.202' });
artnetA.setHost('2.39.2.100');

k-yle added a commit to k-yle/artnet that referenced this issue Oct 2, 2019
@k-yle k-yle mentioned this issue Oct 2, 2019
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

1 participant