hiroyuki / ofxArtnet

ultra simple artnet addon for openFrameworks
MIT License
68 stars 31 forks source link

Failed to start: Failed to bind to socket Address already in use #12

Closed jmarsico closed 5 years ago

jmarsico commented 9 years ago

Hello, Using 0.84, OSX 10.10 and also 10.9. I am having trouble with sockets getting stuck. First time running an application (the example as well as my app), I can open the connection to the artnet device, but once i close that app and re-run, i get the node not found error. When i put the setup function in a while loop: while(artnet.nodes_found == 0) artnet.setup(localIP.c_str()); i get the response Failed to start: Failed to bind to socket Address already in use . I'm not sure where that error is coming from, as i can't find it in the xcode project. any help is much appreciated!

jmarsico commented 9 years ago

I'm thinking it is related to this bug in OLA https://github.com/OpenLightingProject/ola/issues/455.

hiroyuki commented 9 years ago

I think that is because of re-binding same port by your app in

while(artnet.nodes_found == 0) artnet.setup(localIP.c_str());

I have no idea why you keep doing setup while the nodes are not found. You can do setup once when you run your app.

I checked latest example with OS10.10 and run and re-run the example. But That kind of error does not occur.

Please check the example and make sure that kind of error can be occurred every time. And let me know if that happen again.

thanks,

jmarsico commented 9 years ago

the while line was just to see if I could force things to happen. I originally thought the issue was with artnet.setup. I am not using that while loop normally. I am also seeing this issue with the example. It will run the first time, then if I close the app and re-run it, I get the node not found. This does not happen every time. Sometimes I can re-run the app once, but if I close it and re-run again, I get the error. I tried to modify the destructor in ofxartnet.cpp to explicitly call artnet_stop(node), but i see the same issue.

I am using a Dmxking eDMX1 device, not an Enttec ODE; however i think both of those devices just receive the packets so possibly the device shouldn't matter. I'll keep looking and post any answers I find.

nanu-c commented 9 years ago

Failed to start: Failed to bind to socket Address already in use This means normally that the port you wanna use is already taken. Have you other artnet processes running on your machine? you can try another port with the second argument of the setup(const char* interfaceIP, int port_addr, int verbose)