[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

[ANN] Jabber-RPC

Massimiliano Mirra - bard

12/8/2004 2:05:00 PM


Ever thought it would be nice to call objects located anywhere in the
world, without bothering with static IPs, DNS, Apache, CGI, NAT, PAT,
gateways, authentication, and so on?

Jabber-RPC lets you do this. On the callee side you have:

require "jabber/rpc"

class TestAgent < Jabber::RPC::BasicAgent
def exposed_commands
["alive?"]
end

def alive?
true
end
end

agent = TestAgent.new("bot@jabberserver.com/TestAgent", "bot")
agent.connect


On caller, you have:

session = Jabber::Session.bind("user@jabberserver/Ruby", "user")
remote_agent = Jabber::RPC::Client.new(session, "bot@jabberserver.com/TestAgent").proxy3
remote_agent.alive? #=> true


And with a bit more code, remote users can talk to the object through
an IM client, too.

Find it at: http://jabber-rpc.rub...


Massimiliano

2 Answers

Raphael Bauduin

12/8/2004 3:20:00 PM

0

Massimiliano Mirra - bard wrote:
> Ever thought it would be nice to call objects located anywhere in the
> world, without bothering with static IPs, DNS, Apache, CGI, NAT, PAT,
> gateways, authentication, and so on?
>
> Jabber-RPC lets you do this. On the callee side you have:
>
> require "jabber/rpc"
>
> class TestAgent < Jabber::RPC::BasicAgent
> def exposed_commands
> ["alive?"]
> end
>
> def alive?
> true
> end
> end
>
> agent = TestAgent.new("bot@jabberserver.com/TestAgent", "bot")
> agent.connect
>
>
> On caller, you have:
>
> session = Jabber::Session.bind("user@jabberserver/Ruby", "user")
> remote_agent = Jabber::RPC::Client.new(session, "bot@jabberserver.com/TestAgent").proxy3
> remote_agent.alive? #=> true
>
>
> And with a bit more code, remote users can talk to the object through
> an IM client, too.
>
> Find it at: http://jabber-rpc.rub...
>
>
> Massimiliano
>

Cool! Testing this has just been added to my todo list ;-)

Raph

Aredridel

12/8/2004 10:03:00 PM

0

On Wed, 8 Dec 2004 23:07:36 +0900, Massimiliano Mirra - bard
<mmirra@libero.removethis.it> wrote:
>
> Ever thought it would be nice to call objects located anywhere in the
> world, without bothering with static IPs, DNS, Apache, CGI, NAT, PAT,
> gateways, authentication, and so on?
>
> Jabber-RPC lets you do this. On the callee side you have:

A proper install procedure:
mkdir lib/jabber -p
mv rpc.rb lib/jabber/rpc.rb
cp /path/to/setup.rb .

Then build as you would any setup.rbified package.