aberant / osc-ruby

Open Sound Control Library for Ruby
MIT License
94 stars 16 forks source link

this was something i needed to be configurable... #2

Closed razic closed 13 years ago

razic commented 13 years ago

maybe more will as well

aberant commented 13 years ago

thanks for the patch! i'm about to go on vacation for a week, but i'll look at this when i get back. in the meantime, can you explain the use case for this patch? i'll make sure to update the docs for others who might want to do the same thing you are doing.

razic commented 13 years ago

just giving people the ability to change the hostname of the UDPSocket object in your Server class.

you allow this to be done for the Client but not Server.

i used your library to set up a server and listen for OSC messages that i was sending from my iphone over wi-fi.

aberant commented 13 years ago

i just tested this on my MBP and ubuntu VM and confirmed that passing an empty string as the hostname parameter to the bind method on an UDPSocket object causes it to listen on ALL available network interfaces.

here is what lsof has to say about it when i started a server on port 5000 (using OSC::Server.new(5000) )

aberant@aberant-vm:~$ lsof -i -P
COMMAND  PID    USER   FD   TYPE DEVICE SIZE/OFF NODE NAME
ruby    1738 aberant    3u  IPv4  11902      0t0  UDP *:5000

so, were you not able to get the OSC::Server to respond unless you specified the host? i'm not able to recreate the problem that would necessitate specifying a host so i'm scratching my head right now. is there something special about your setup that would require this? any further information would be really helpful for me to get to the root of this issue.

razic commented 13 years ago

you're right.

i'm not sure why it wasn't working before. i've moved to just using a udp socket as the gem was a little too high level for what i needed.

but thanks for the tip about empty string == *:port

and sorry for the false commit

razic commented 7 years ago

Just reminiscing on my first-ever pull-request.