Skip to content

Commit

Permalink
feat: IP resolution to hostname
Browse files Browse the repository at this point in the history
  • Loading branch information
Xeroxxhah authored Feb 28, 2022
1 parent 216ba84 commit 2749d1a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions core/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ def send(self, file, to):
progress = tqdm.tqdm(range(filesize), f"Sending {filename}", unit="B", unit_scale=True, unit_divisor=1024)
with open(file, 'rb') as f:
while True:
data = f.read(1024)
data = f.read(4096)
if not data:
break
sok.sendall(data)
Expand All @@ -42,5 +42,5 @@ def send(self, file, to):
def sendping(self,host):
pingsok = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
pingsok.connect((host,5656))
pingsok.send('ping'.encode('utf-8'))
pingsok.send(f'ping:{str(socket.gethostname())}'.encode('utf-8'))
pingsok.close()

0 comments on commit 2749d1a

Please sign in to comment.