[OpenDHT-Users] put_removable not working with Ruby

Andrew Yourtchenko ayourtch@gmail.com
Mon, 1 May 2006 18:41:26 +0200


I have used the following construct:

  def binary(value)
    XMLRPC::Base64.new(value,:dec)
  end

And then further along:

  def []=3D(key,data)
    shash =3D keyhash(get_secret(data))
    res =3D @server.call("put_removable", keyhash(key),
          binary(data), "SHA", shash,
          @ttl, "put");
....


If you are interested to take a look at some working code, I've put it
at http://stdio.be/dg/bamboo.rb - although it's more a mockup I've
been playing with, so beware its ugliness.

Improvements are welcome.

cheers,
andrew


On 5/1/06, Alyed Tzompa <alyed.tzompa@simitel.com> wrote:
>
>
>  Hi there!
>
> I'm having problems making a "put_removable" (actually not even a "put"
> works for me) to openDHT. I'm using Ruby 1.8.4-16 and get the following
> message:
>
> java.lang.NoSuchMethodException:
> bamboo.dht.Gateway$XmlRpcPutRemovableHandler.put_removable(java.lang.Stri=
ng,
> java.lang.String, java.lang.String, java.lang.String, int, java.lang.Stri=
ng,
> java.lang.String, java.net.InetSocketAddress, bamboo.util.Curry$Thunk1)
>
> Searched on the mailing list but only found a similiar problem whose
> solution was placing the parameters in the correct order. I've checked mi=
nes
> (Key,Value,"SHA",hashed_secret,TTL, Appl_name) but keep on
> receiving the same message.
>
> Any ideas?
>
> Alyed
>
> --------------------------------------
> #code extract
>
> dhtServer =3D XMLRPC::Client.new("169.229.50.15","/",5851)
> dhtKey64 =3D Base64.encode64(dhtKey)
> dhtValue64 =3D Base64.encode64(dhtValue)
>
>  begin
>
> dhtStatus =3D
> dhtServer.call("put_removable",dhtKey64,dhtValue64,"SHA",secret.toSha,60.=
to_i,"my_app")
>   rescue XMLRPC::FaultException =3D> error
>   puts error.faultCode
>   puts error.faultString
>
> end
> ----------------------------------
>
>
>