From: Sai Hl Date: 2009-03-02T08:00:36+09:00 Subject: Re: Gets the broadcast address of an IP address Brian Candler wrote: > This is messier than it should be, but: > > require 'ipaddr' > n = IPAddr.new("192.168.0.101/24") > p n | (~n.instance_variable_get(:@mask_addr) & IPAddr::IN4MASK) > > Or maybe you could just broadcast to the all-ones address > (255.255.255.255) Yes, I had use the broadcast address ;) Finaly it's simple and efficient. But I think I will try your first solution after to. Thanks -- Posted via http://www.ruby-forum.com/.