Created
September 20, 2012 06:45
-
-
Save mariodavid/3754299 to your computer and use it in GitHub Desktop.
TomP2P - Send Message directly to a certain content hash
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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