Handles IO Error in network and restarts thread.