client c: connection error handling