reformat
handle io exception, restart tcp client
add unit test to verify client reconnect works