To the moment, I found that if host name is invalid, I get Exception with HResult=-2147013895 and If the host name is OK but it refuses the connection attempt, I'm getting System.Runtime.InteropServices.COMException with HResult=-2147014835. No InnerException is available. Because exception types are pretty generic, I'll have to catch Exception, analyse HResult and rethrow if this exception is not specific to network issues. Seems I need to find out which HResult codes to process in my code (all network-related) and re-throw anything else (out of memory and so on).
Is there any list of HResult codes which are specific to network issues? Or maybe there is another, better way to distinguish between network-specific and general exceptions which can be thrown during StreamSocket.ConnectAsync call?