# Examples using reliable-msg gem?

**URL:** <https://www.ruby-forum.com/t/examples-using-reliable-msg-gem/60586>\
**Category:** Ruby\
**Created:** [May 15, 2006, 10:17pm UTC](https://www.ruby-forum.com/t/examples-using-reliable-msg-gem/60586 "2006-05-15T22:17:42Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![unknown](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/u/4bbf92/32.png) [@unknown](https://www.ruby-forum.com/u/unknown)\
**Post date:** [May 15, 2006, 10:17pm UTC](https://www.ruby-forum.com/t/examples-using-reliable-msg-gem/60586/1 "2006-05-15T22:17:42Z")

</div>

I’m wondering if anyone out there has written any code using the  
reliable-msg gem.

It looks like a great system but I’m having a lot of trouble getting  
it to work.

For example, I can’t get a Queue to successfully put/talk to a  
QueueManager (essentially a DRb server) process unless it is running  
within the same Ruby process. The documentation talks about running  
the QueueManager in a separate process or even on a separate machine,  
but every attempt at this fails. I’ve been digging through the code  
but nothing obvious has jumped out at me.

I figure I need to be a DRb expert to understand it fully but I’m  
using this gem because I don’t _want_ to be a DRb expert.

So, has any kind soul out there been successful in writing any code  
using reliable-msg? If so, would you be willing to share your  
insights (if not your code)?

Thanks…

cr

---

<div class="post-metadata">

**Author:** ![unknown](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/u/4bbf92/32.png) [@unknown](https://www.ruby-forum.com/u/unknown)\
**Post date:** [May 17, 2006, 5:55am UTC](https://www.ruby-forum.com/t/examples-using-reliable-msg-gem/60586/2 "2006-05-17T05:55:34Z")

</div>

I figured out the problem. In the queue-manager.rb file the author  
sets up an ACL for the DRbServer. The acl contains “allow 127.0.0.1”.  
For whatever reason, OSX binds to the port using IPv6 so the ACL  
denies any connections coming through the loopback.

There are two fixes. One workaround is to eliminate the ACL.

The second workaround is to change the acl to read “allow 127.0.0.1,  
allow ::1” where “::1” is the localhost equivalent for IPv6  
(alternately, change 127.0.0.1 to localhost). After this change inter-  
process calls work.

I hope the next person who runs into this problem finds this note. It  
only took me 2 days to figure it out. 🙂

cr

---

<div class="post-metadata">

**Author:** ![unknown](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/u/4bbf92/32.png) [@unknown](https://www.ruby-forum.com/u/unknown)\
**Post date:** [May 17, 2006, 6:17am UTC](https://www.ruby-forum.com/t/examples-using-reliable-msg-gem/60586/3 "2006-05-17T06:17:01Z")

</div>

On Wed, 17 May 2006 removed\_email\_address@domain.invalid wrote:

> I hope the next person who runs into this problem finds this note. It only  
> took me 2 days to figure it out. 🙂

thank you for posting it!

-a

---

<div class="post-metadata">

**Author:** ![unknown](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/u/4bbf92/32.png) [@unknown](https://www.ruby-forum.com/u/unknown)\
**Post date:** [May 18, 2006, 1:50am UTC](https://www.ruby-forum.com/t/examples-using-reliable-msg-gem/60586/4 "2006-05-18T01:50:28Z")

</div>

Quoting removed\_email\_address@domain.invalid, on Wed, May 17, 2006 at 12:52:31PM  
+0900:

> process calls work.  
> Sounds like the code is assuming localhost is 127.0.0.1. This isn’t  
> true, its BOTH ::1 and 127.0.0.1. The code should probably be  
> consistent, either always use localhost, or always use IP addrs, but not  
> both. Or if it can actually use IPv6, maybe it should bind to all the  
> localhost addrs.

Of course, if you don’t have ipv6, there is only one IP addr that  
localhost resolves to. Also, most people take the first addr when they  
resolve a name, so if the first is usually ipv4, but sometimes (OS X,  
for example) ipv6, you get strangeness.

> I hope the next person who runs into this problem finds this note. It  
> only took me 2 days to figure it out. 🙂

Ouch!

Once bitten, you know… ruby code that does gethostbyname() for  
“localhost” and assumes the addr is ipv4 will not run on OS X (unless  
the OS X box has IPv6 turned off).

Sam
