SMBLibrary
SMBLibrary copied to clipboard
Throw TimeoutException instead of returning null
Thanks, I'll have to think about it. Also note that it would be the first usage of String interpolation using $ in this project, currently I'm maintaining C# 2.0 compatibility due to historic reasons, it's probably not needed anymore though, but I will not break it over a small thing.
Thanks, I'll have to think about it. Also note that it would be the first usage of String interpolation using $ in this project, currently I'm maintaining C# 2.0 compatibility due to historic reasons, it's probably not needed anymore though, but I will not break it over a small thing.
When are you going to ever use a version of the compiler before 2005? The latest compiler version are backwards compatible all the way to 1.0. There is no reason to target a language version earlier than the lowest target runtime which in this case is .NET framework 4.0. That means at a bare minimum you should be targeting 7.3 and even that isn't required because 99% of language features don't require runtime capabilities.
https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/configure-language-version#defaults
Hi Kieran,
- VS2005 support was dropped last week, you can now use string interpolation using $.
- I'm still not sure if I prefer throwing an exception or returning NTStatus.STATUS_INVALID_SMB, I'm leaning towards throwing an exception though.
In principle you are right, if the server fails to respond in time the exception should be TimeoutException. In practice however it makes the client sample code longer (and I have an issue when first establishing connection where it may seem like a timeout but it's actually not an SMB server). it's also a breaking change. So I'm not 100% there yet.