Add support for reconnection after timeout or error
Add command line options for host and port
Enable input from console