[tcp client] improved error handling;