# MulticastSocket in Ruby

**URL:** <https://www.ruby-forum.com/t/multicastsocket-in-ruby/60417>\
**Category:** Ruby\
**Created:** [May 13, 2006, 11:49am UTC](https://www.ruby-forum.com/t/multicastsocket-in-ruby/60417 "2006-05-13T11:49:40Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![dirk](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/87869e/32.png) [@dirk](https://www.ruby-forum.com/u/dirk)\
**Post date:** [May 13, 2006, 11:49am UTC](https://www.ruby-forum.com/t/multicastsocket-in-ruby/60417/1 "2006-05-13T11:49:40Z")

</div>

Hi Folks,

I need some halp with Multicast Sockets. Is it possible to establish a  
multicst socket in Ruby? I believe it ist, but have no idea how it could  
work. I asked Google already for help, but with no success. So I ask  
here. I already tried to solve this with using UDPSocket, but that  
failed, too.

Is there any class, package or extension for this task or could you give  
me a hint for doing this with the existing sockets?

Thanks a lot in advance.

greetz

dirk

---

<div class="post-metadata">

**Author:** ![dirk](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/87869e/32.png) [@dirk](https://www.ruby-forum.com/u/dirk)\
**Post date:** [May 16, 2006, 6:23am UTC](https://www.ruby-forum.com/t/multicastsocket-in-ruby/60417/2 "2006-05-16T06:23:59Z")

</div>

Quoting removed\_email\_address@domain.invalid, on Sat, May 13, 2006 at 06:49:49PM +0900:

> I need some halp with Multicast Sockets. Is it possible to establish a  
> multicst socket in Ruby? I believe it ist, but have no idea how it could  
> work. I asked Google already for help, but with no success. So I ask  
> here. I already tried to solve this with using UDPSocket, but that  
> failed, too.

Use the low level apis of class Socket. They behave almost the same as  
the BSD socket apis.

> Is there any class, package or extension for this task or could you give  
> me a hint for doing this with the existing sockets?

If you want an example, multicast DNS uses multicast UDP, both send and  
receive, look at [http://dnssd.rubyforge.org](http://dnssd.rubyforge.org), check out the source in  
net-mdns.

Cheers,  
Sam

---

<div class="post-metadata">

**Author:** ![dirk](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/87869e/32.png) [@dirk](https://www.ruby-forum.com/u/dirk)\
**Post date:** [May 16, 2006, 7:58am UTC](https://www.ruby-forum.com/t/multicastsocket-in-ruby/60417/3 "2006-05-16T07:58:02Z")

</div>

On Tue, May 16, 2006 at 01:22:55PM +0900, Sam R. wrote:  
[snip]

> If you want an example, multicast DNS uses multicast UDP, both send and  
> receive, look at [http://dnssd.rubyforge.org](http://dnssd.rubyforge.org), check out the source in  
> net-mdns.

Wow! That link is great! This will go quite well with  
Net::DAAP::Client ( [http://rubyforge.org/projects/daapclient/](http://rubyforge.org/projects/daapclient/) ). Yay!

–Aaron

---

<div class="post-metadata">

**Author:** ![dirk](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/87869e/32.png) [@dirk](https://www.ruby-forum.com/u/dirk)\
**Post date:** [May 16, 2006, 5:37pm UTC](https://www.ruby-forum.com/t/multicastsocket-in-ruby/60417/4 "2006-05-16T17:37:08Z")

</div>

On Tue, May 16, 2006 at 02:57:42PM +0900, Aaron P. wrote:

> On Tue, May 16, 2006 at 01:22:55PM +0900, Sam R. wrote:  
> [snip]
> 
> > If you want an example, multicast DNS uses multicast UDP, both send and  
> > receive, look at [http://dnssd.rubyforge.org](http://dnssd.rubyforge.org), check out the source in  
> > net-mdns.
> 
> Wow! That link is great! This will go quite well with  
> Net::DAAP::Client ( [http://rubyforge.org/projects/daapclient/](http://rubyforge.org/projects/daapclient/) ). Yay!

That looks pretty interesting, too, I’ll keep an eye on it.

You might want to use the cvs version, there are some new easier-to-use  
apis in the C bindings, and at least one bug fix. Charles and I probably  
should re-sync the APIs and re-release but we don’t hear much feedback  
about DNS-SD, so its not very motivating.

Cheers,  
Sam

---

<div class="post-metadata">

**Author:** ![dirk](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/87869e/32.png) [@dirk](https://www.ruby-forum.com/u/dirk)\
**Post date:** [May 19, 2006, 3:37pm UTC](https://www.ruby-forum.com/t/multicastsocket-in-ruby/60417/5 "2006-05-19T15:37:49Z")

</div>

Thanks a lot for your help.

Sorry that I response that late, but I had a little trouble with  
finishing of my Bachelorthesis.

This here is for another project.

So thanks again for your help.

greetz

dirk
