Skip to content

Instantly share code, notes, and snippets.

@mariodavid
Created September 20, 2012 06:45
Show Gist options
  • Save mariodavid/3754299 to your computer and use it in GitHub Desktop.
Save mariodavid/3754299 to your computer and use it in GitHub Desktop.
TomP2P - Send Message directly to a certain content hash
// create hash of our content "test"
Number160 contentHash = Number160.createHash("test");
// find the responsible peer (the hash of it) of the content
Number160 destination = peer.getPeerBean().getStorage()
.findPeerIDForResponsibleContent(contentHash);
// send a message to this peer
FutureDHT future = peer.send(destination).setObject("this is the message").start();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment