Permalink
Browse files

Add a onGet to debug.

This way you can send a get request via the UDP connection,
for an example see the file get.txt
  • Loading branch information...
nikhilm committed Mar 18, 2012
1 parent 4a500b0 commit e65be3633aa6f8ee7ab9beccc200f74f8aad9ebf
Showing with 11 additions and 0 deletions.
  1. +4 −0 get.txt
  2. +7 −0 lib/knode.js
View
@@ -0,0 +1,4 @@
+{"type":"GET","key":"foo",
+"nodeID":"75358e37c9d268526907adf2acfe3c25d548e392",
+"address": "10.100.98.60",
+"port": "10001"}
View
@@ -137,6 +137,13 @@ exports.KNode.prototype._onStore = function(message) {
// This is just to prevent Unknown message errors
exports.KNode.prototype._onStoreReply = function() {}
+// debug methods FIXME: remove
+exports.KNode.prototype._onGet = function(message) {
+ this.get(message.key, function(err, val) {
+ console.log('ONGET', val);
+ });
+}
+
exports.KNode.prototype._onFindValue = function(message) {
assert.ok(message.key);
assert.equal(message.key.length, constants.B/4);

0 comments on commit e65be36

Please sign in to comment.