.NET 4.5 and Asynchronous Winsock with OVERLAPPED (no IFS Winsock BSP or LSP)

I've been looking into one of the questions I'm running into, which is similar to the question here . Basically the problem is that the client application cannot connect to the database. It looks like the permission says that an application is installed that is incompatible with the network protocol, and we must remove this application.

Based on my testing, uninstall .NET 4.5 and download .NET 4.0, also do the trick and I want to know why. After researching more, I found the following:

There are changes in .NET 4.5 that make SQLClient support asynchronous as per this Microsoft article ,

Because of this change, any application using asynchronous Winsock with an OVERLAPPED structure since .NET 4.5 will cause the application to not experience Winsock call completion.

My reaction to this is, isn't this considered a .NET 4.5 bug?

+3


source to share


2 answers


You can call this a Windows bug, but it is definitely not a .NET or SQL Server bug.

Winsock has two types of filters: IFS and non-IFS. IFS drivers reuse Winsock functionality, not IFS completely overrides it.

Prior to Windows Vista, asynchronous calls will receive a return value that indicates immediate success and will be notified of completion. Vista has added an enhanced enhancement mode that removes this redundant notification. IFS drivers got this for free, while non-IFS drivers now need to be updated for support.

So you can call it a Windows bug by not maintaining backward compatibility with the legacy API. Perhaps this was simply not possible and their new runway architecture was replaced. I'd say it's closer to a driver error - you can't say you're Vista compatible and then you forget to implement one of the APIs.



Anyway, this is a valid Windows feature and .NET / SQL is free to use it in full to add perf. Per KB2568167 , you can run this command to determine exactly which driver is causing the problem:

netsh WinSock Show Catalog

      

If the service flag value has the 0x20000 bit set, the provider uses IFS to process and will work correctly. If bit 0x20000 is clear (not set), it is a non-IFS BSP or LSP.

+3


source


No, this is not a bug in the .NET. NET Framework can assume that the underlying networking infrastructure is functioning correctly. If a broken WinSock provider is installed, there is nothing .NET as a whole can do to access the database.



Also .NET Framework is not responsible for handling bugs in third-party installed software, and it is generally impossible to provide such behavior.

+1


source







All Articles