KTcpSocket is a QIODevice, internally using a Qt socket - however it does not set the error string of itself when the internal socket signals some error condition.
The original problem I had with this was the PIM maildispatcher - in the lack of any error string - just showing an error number when notifying the user. But a "Failed to transport message. 3" does not really say much to the user.
Now at least I get "Failed to transport message. Host not found"