Forums | Admin

Discussion Forums: open-discussion

Start New Thread Start New Thread

 

By: shunichi shinohara
patch: specify the bind address by config [ reply ]  
2007-10-10 08:30
At first, thanks for nice library!

I wrote a patch which enables to configure reliable-msg to listen on a specified address rather than "localhost".

An output of "cvs diff" for CVS HEAD (2007/04/02) is as follows:

=== BEGIN OF CVS DIFF
cvs diff: Diffing .
cvs diff: Diffing bin
cvs diff: Diffing lib
cvs diff: Diffing lib/reliable-msg
Index: lib/reliable-msg/client.rb
===================================================================
RCS file: /var/cvs/reliable-msg/reliable-msg/lib/reliable-msg/client.rb,v
retrieving revision 1.1
diff -r1.1 client.rb
26a27,29
> # The default DRb host used to connect to the queue manager.
> DRB_HOST = "localhost"
>
30c33
< DEFAULT_DRB_URI = "druby://localhost:#{DRB_PORT}"; #:nodoc:
---
> DEFAULT_DRB_URI = "druby://#{DRB_HOST}:#{DRB_PORT}"; #:nodoc:
Index: lib/reliable-msg/queue-manager.rb
===================================================================
RCS file: /var/cvs/reliable-msg/reliable-msg/lib/reliable-msg/queue-manager.rb,v
retrieving revision 1.3
diff -r1.3 queue-manager.rb
34a35
> "host" => Client::DRB_HOST,
209c210
< drb_uri = "druby://localhost:#{drb['port']}";
---
> drb_uri = "druby://#{drb['host']}:#{drb['port']}";

=== END OF CVS DIFF


An example of configuration file is..

==
---
store:
type: disk
drb:
host: 0.0.0.0
port: 6438
acl: allow all
== END OF EXAMPLE CONFIG FILE

I'll be glad if you feel this patch is useful.

shino