Thanks Jeremiah,
I guess I didn't find this article because I was searching for ConnectToTCP! However, it covers a slightly different case than mine, but the concern is the same, I'm sure.
Anyway, All works OK when the server is actually there, just the misleading error when it isn't. I also noticed the same response when the host is correct, but the port (service) is not registered. Fundamentally, there is an invalid parameter, but a similar error is given from other libraries (like UIL) with different meanings. I don't expect perfection, I just thought I'd bring to your attention.
Thanks for your response.