Skip to content

Commit

Permalink
Updated Client.py and Node_DHT.py
Browse files Browse the repository at this point in the history
  • Loading branch information
paliwal-jatin committed Apr 23, 2020
1 parent 80e11c0 commit 79454ff
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
9 changes: 6 additions & 3 deletions Client.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,25 +20,28 @@ def main():
sock.connect((ip,port))

if(choice == '1'):
key = input("ENTER THE KEY")
val = input("ENTER THE VALUE")
key = input("ENTER THE KEY : ")
val = input("ENTER THE VALUE : ")
message = "insert|" + str(key) + ":" + str(val)
sock.send(message.encode('utf-8'))
data = sock.recv(1024)
data = str(data.decode('utf-8'))
print(data)

elif(choice == '2'):
key = input("ENTER THE KEY")
message = "search|" + str(key)
sock.send(message.encode('utf-8'))
data = sock.recv(1024)
print(data)
data = str(data.decode('utf-8'))
print("The value corresponding to the key is : ",data)

elif(choice == '3'):
key = input("ENTER THE KEY")
message = "delete|" + str(key)
sock.send(message.encode('utf-8'))
data = sock.recv(1024)
data = str(data.decode('utf-8'))
print(data)

elif(choice == '4'):
Expand Down
4 changes: 3 additions & 1 deletion Node_DHT.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@
import random
import sys
from copy import deepcopy
m = 6

m = 7

class DataStore:
def __init__(self):
self.data = {}
Expand Down

0 comments on commit 79454ff

Please sign in to comment.