forked from Krautspace/doorstatus
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:
parent
fd49e706f3
commit
5522e04840
1 changed files with 7 additions and 1 deletions
|
@ -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__':
|
||||||
|
|
Loading…
Reference in a new issue