client-clear.py: bugs in main() and read_argument() fixed

read_argument(): return now outside from while loop. loop works now until a valid value ist
entered. main(): reads now a return value from server and close the socket.
This commit is contained in:
berhsi 2019-07-26 22:02:01 +02:00
parent fd49e706f3
commit 5522e04840

View file

@ -58,6 +58,12 @@ def main():
except Exception as e: except Exception as e:
print('Error: {}'.format(e)) print('Error: {}'.format(e))
exit() exit()
try:
res = mySocket.recv(1)
print('Server returns: {}'.format(res.decode()))
finally:
mySocket.close()
print('Disconnect from server')
if __name__ == '__main__': if __name__ == '__main__':