-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathClient_04.py
More file actions
53 lines (36 loc) · 1.19 KB
/
Client_04.py
File metadata and controls
53 lines (36 loc) · 1.19 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
import socket
import random
import time
t = round(time.time() * 1000)
t = str(t)
t = t[int(-random.random()):int(t)]
t = int(t) ** abs(int(random.random()*10000))
print(t)
# t = int(t)
def generate_partial_phrase(x):
random.seed(x)
y = random.random()
z = y
random.seed(z)
return random.random()
randoms = (int(generate_partial_phrase(t) * 10 ** 8))
HOST = '127.0.0.1'
PORT = 9090
client = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
client.connect((HOST, PORT))
# data = input("Enter data that you want to send")
# client.send(data.encode('utf-8'))
client.send("Hello World\n".encode('utf-8'))
# client.send("Hello World again\n".encode(('utf-8')))
# client.send("Hello World again and again\n".encode(('utf-8')))
# client.send("Hello World again and again and again\n".encode(('utf-8')))
# print whatever you receive form the server
received_message = client.recv(1024).decode('utf-8')
print(received_message)
received_message = client.recv(1024).decode('utf-8')
print(received_message)
lists = received_message.split(" ")
print(lists)
generated_seed = str(randoms)
print(f"This is the generated seed: {generated_seed}")
client.send(f"{generated_seed}".encode('utf-8'))