Make code-style PEP 8 compliant
Improve code-style: remove redundant parentheses etc.
Replace open-try-finally with 'with open'
Remove unnecessary flush()

close() implies flush()
Refactor writing to socket a little
Use iter() instead of while True
Close the view in case the connection is damaged
Add a rsub presence indicator in the status bar
More solid behavior in case the socket connection fails